Merge pull request #116 from brendan-lee/fix/nullProtoObj

Fix hasOwnProperty check failure on null proto object
This commit is contained in:
Rainer Simon 2023-03-09 18:20:47 +01:00 committed by GitHub
commit 9580a0c6ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
);
}