Merge pull request #116 from brendan-lee/fix/nullProtoObj
Fix hasOwnProperty check failure on null proto object
This commit is contained in:
commit
9580a0c6ff
|
@ -15,7 +15,7 @@ const isComment = (body, matchAllPurposes) => {
|
||||||
validPurposes.indexOf(body.purpose) > -1 : body.purpose == 'commenting' || body.purpose == 'replying';
|
validPurposes.indexOf(body.purpose) > -1 : body.purpose == 'commenting' || body.purpose == 'replying';
|
||||||
|
|
||||||
return body.type === 'TextualBody' && (
|
return body.type === 'TextualBody' && (
|
||||||
!body.hasOwnProperty('purpose') || hasMatchingPurpose
|
!Object.prototype.hasOwnProperty.call(body, 'purpose') || hasMatchingPurpose
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue