From bd192993b7369feacd82ecef551eeaa61fea658d Mon Sep 17 00:00:00 2001 From: tofers Date: Sun, 15 Jan 2023 21:35:26 +0300 Subject: [PATCH] fix method downloadMedia when not found msg (#1852) Co-authored-by: Rajeh Taher --- src/structures/Message.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/structures/Message.js b/src/structures/Message.js index ee79c20..7ac5536 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -386,7 +386,9 @@ class Message extends Base { const result = await this.client.pupPage.evaluate(async (msgId) => { const msg = window.Store.Msg.get(msgId); - + if (!msg) { + return undefined; + } if (msg.mediaData.mediaStage != 'RESOLVED') { // try to resolve media await msg.downloadMedia({