diff --git a/src/lib/wapi/functions/reply.js b/src/lib/wapi/functions/reply.js index cc4603fa1..f2bb5597d 100644 --- a/src/lib/wapi/functions/reply.js +++ b/src/lib/wapi/functions/reply.js @@ -59,7 +59,7 @@ export async function reply(chatId, content, quotedMessageId) { let quotedMsgOptions = {}; if (quotedMessageId) { let quotedMessage = window.Store.Msg.get(quotedMessageId); - if (quotedMessage.canReply()) { + if (quotedMessage && quotedMessage.canReply()) { quotedMsgOptions = quotedMessage.msgContextInfo(chat); } } diff --git a/src/lib/wapi/functions/sendMessageOptions.js b/src/lib/wapi/functions/sendMessageOptions.js index 4843d4ae4..9cc72184a 100644 --- a/src/lib/wapi/functions/sendMessageOptions.js +++ b/src/lib/wapi/functions/sendMessageOptions.js @@ -74,7 +74,7 @@ export async function sendMessageOptions(chatId, content, options = {}) { let quotedMsgOptions = {}; if (options.quotedMessageId) { let quotedMessage = window.Store.Msg.get(options.quotedMessageId); - if (quotedMessage.canReply()) { + if (quotedMessage && quotedMessage.canReply()) { quotedMsgOptions = quotedMessage.msgContextInfo(chat); } delete options.quotedMessageId;