Skip to content

Commit

Permalink
fix: Fixed error on replying a invalid message (close #320)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Nov 16, 2020
1 parent 9925982 commit 917db7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/sendMessageOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 917db7a

Please sign in to comment.