fix: properly handle unresolved media
This commit is contained in:
parent
5934ec531f
commit
25b96378c7
1 changed files with 3 additions and 2 deletions
|
|
@ -186,7 +186,7 @@ class Message extends Base {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
const {data, mimetype, filename} = await this.client.pupPage.evaluate(async (msgId) => {
|
||||
const result = await this.client.pupPage.evaluate(async (msgId) => {
|
||||
const msg = window.Store.Msg.get(msgId);
|
||||
|
||||
if(msg.mediaData.mediaStage != 'RESOLVED') {
|
||||
|
|
@ -211,7 +211,8 @@ class Message extends Base {
|
|||
|
||||
}, this.id._serialized);
|
||||
|
||||
return new MessageMedia(mimetype, data, filename);
|
||||
if(!result) return undefined;
|
||||
return new MessageMedia(result.mimetype, result.data, result.filename);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue