From ed8f087eb6bedf6b973fcb26dd325b13e3f99785 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 6 Mar 2018 15:17:57 +0000 Subject: [PATCH] fix access of element [0] of array even though it sometimes does not exist Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/elements/ReplyThread.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/ReplyThread.js b/src/components/views/elements/ReplyThread.js index a4728ac67a..059df7a01c 100644 --- a/src/components/views/elements/ReplyThread.js +++ b/src/components/views/elements/ReplyThread.js @@ -142,7 +142,7 @@ export default class ReplyThread extends React.Component { // Part of Replies fallback support static stripPlainReply(body) { const lines = body.split('\n'); - while (lines[0].startsWith('> ')) lines.shift(); + while (lines.length && lines[0].startsWith('> ')) lines.shift(); return lines.join('\n'); }