Add check for body
parent
3d1a0ccf12
commit
c0282e0351
|
@ -60,6 +60,9 @@ function getHtmlReplyFallback(mxEvent: MatrixEvent): string {
|
||||||
|
|
||||||
function getTextReplyFallback(mxEvent: MatrixEvent): string {
|
function getTextReplyFallback(mxEvent: MatrixEvent): string {
|
||||||
const body = mxEvent.getContent().body;
|
const body = mxEvent.getContent().body;
|
||||||
|
if (!body) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
const lines = body.split("\n").map(l => l.trim());
|
const lines = body.split("\n").map(l => l.trim());
|
||||||
if (lines.length > 2 && lines[0].startsWith("> ") && lines[1].length === 0) {
|
if (lines.length > 2 && lines[0].startsWith("> ") && lines[1].length === 0) {
|
||||||
return `${lines[0]}\n\n`;
|
return `${lines[0]}\n\n`;
|
||||||
|
|
Loading…
Reference in New Issue