mirror of https://github.com/vector-im/riot-web
fix access of element [0] of array even though it sometimes does not exist
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
3b02766be9
commit
ed8f087eb6
|
@ -142,7 +142,7 @@ export default class ReplyThread extends React.Component {
|
||||||
// Part of Replies fallback support
|
// Part of Replies fallback support
|
||||||
static stripPlainReply(body) {
|
static stripPlainReply(body) {
|
||||||
const lines = body.split('\n');
|
const lines = body.split('\n');
|
||||||
while (lines[0].startsWith('> ')) lines.shift();
|
while (lines.length && lines[0].startsWith('> ')) lines.shift();
|
||||||
return lines.join('\n');
|
return lines.join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue