1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

fix access of element [0] of array even though it sometimes does not exist

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2018-03-06 15:17:57 +00:00
parent 3b02766be9
commit ed8f087eb6

View File

@ -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');
}