From 6b4b7788908d4a6e250f04982e60327955798349 Mon Sep 17 00:00:00 2001 From: Brendan Lee Date: Thu, 9 Mar 2023 11:42:24 +0800 Subject: [PATCH] Fix hasOwnProperty check failure on null proto object --- src/editor/widgets/comment/CommentWidget.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/widgets/comment/CommentWidget.jsx b/src/editor/widgets/comment/CommentWidget.jsx index fc6d266..34e67ee 100644 --- a/src/editor/widgets/comment/CommentWidget.jsx +++ b/src/editor/widgets/comment/CommentWidget.jsx @@ -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 ); }