Add null-check

This commit is contained in:
N-Pex 2022-10-19 16:44:36 +02:00
parent 8b1754082f
commit 4f6034aaa6

View file

@ -82,7 +82,7 @@ export default {
while (lines.length && !lines[0].startsWith('> ')) lines.shift();
// Reply fallback has a blank line after it, so remove it to prevent leading newline
if (lines[0] === '') lines.shift();
const text = lines[0].replace(/^> (<.*> )?/g, '');
const text = lines[0] && lines[0].replace(/^> (<.*> )?/g, '');
if (text) {
return text;
}