Fix Cannot read properties of undefined (reading 'mediaStage') in message.js (#2556)

* Update Message.js

Fix Cannot read properties of undefined (reading 'mediaStage') when msg or msg.mediaData is undefined.

* node 13 compatible

---------

Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
This commit is contained in:
Humberto Zambrano 2023-12-07 18:12:58 -05:00 • committed by GitHub
commit b5eb4f97ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -431,7 +431,7 @@ class Message extends Base {
const result = await this.client.pupPage.evaluate(async (msgId) => {
const msg = window.Store.Msg.get(msgId);
if (!msg) {
if (!msg || !msg.mediaData) {
return undefined;
}
if (msg.mediaData.mediaStage != 'RESOLVED') {