[core] NOWEB - handle not found profile picture

This commit is contained in:
devlikepro committed 2025-01-19 14:42:59 +07:00
1 parent e146ecde70
commit 6fc5bf38a7
1 file changed
+12 -2
+12 -2
View File
@@ -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) {