Fix hasOwnProperty check failure on null proto object

This commit is contained in:
Brendan Lee 2023-03-09 11:42:24 +08:00
parent 9c8810eb36
commit 6b4b778890
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ const isComment = (body, matchAllPurposes) => {
validPurposes.indexOf(body.purpose) > -1 : body.purpose == 'commenting' || body.purpose == 'replying';
return body.type === 'TextualBody' && (
!body.hasOwnProperty('purpose') || hasMatchingPurpose
!Object.prototype.hasOwnProperty.call(body, 'purpose') || hasMatchingPurpose
);
}