Merge pull request #2072 from nolramaf/fix/media-content-validation

fix/media content validation
This commit is contained in:
Davidson Gomes 2025-10-13 12:19:05 -03:00 committed by GitHub
commit 37571c03b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -3676,7 +3676,10 @@ export class BaileysStartupService extends ChannelStartupService {
}
}
if ('messageContextInfo' in msg.message && Object.keys(msg.message).length === 1) {
if (
Object.keys(msg.message).length === 1 &&
Object.prototype.hasOwnProperty.call(msg.message, 'messageContextInfo')
) {
throw 'The message is messageContextInfo';
}

View File

@ -826,7 +826,7 @@ export class ChannelStartupService {
const msg = message.message;
// Se só tem messageContextInfo, não é mídia válida
if (Object.keys(msg).length === 1 && 'messageContextInfo' in msg) {
if (Object.keys(msg).length === 1 && Object.prototype.hasOwnProperty.call(msg, 'messageContextInfo')) {
return false;
}