[core] NOWEB - handle not found profile picture
This commit is contained in:
1 parent
e146ecde70
commit
6fc5bf38a7
1 file changed
+12
-2
@@ -1113,8 +1113,18 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
if (isJidStatusBroadcast(id)) {
|
||||
return null;
|
||||
}
|
||||
const url = await this.sock.profilePictureUrl(contact, 'image');
|
||||
return url;
|
||||
try {
|
||||
const url = await this.sock.profilePictureUrl(contact, 'image');
|
||||
return url;
|
||||
} catch (err) {
|
||||
if (err.message == 'item-not-found') {
|
||||
return null;
|
||||
}
|
||||
if (err.message == 'not-authorized') {
|
||||
return null;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
public async blockContact(request: ContactRequest) {
|
||||
|
||||
Reference in new issue
Block a user