[webkit-reviews] review granted: [Bug 223719] bindings/js/JSEventListener.cpp:281:91: runtime error: reference binding to null pointer of type 'WebCore::ScriptExecutionContext' : [Attachment 424203] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Mar 24 17:36:52 PDT 2021
Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 223719: bindings/js/JSEventListener.cpp:281:91: runtime error: reference
binding to null pointer of type 'WebCore::ScriptExecutionContext'
https://bugs.webkit.org/show_bug.cgi?id=223719
Attachment 424203: Patch
https://bugs.webkit.org/attachment.cgi?id=424203&action=review
--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 424203
--> https://bugs.webkit.org/attachment.cgi?id=424203
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=424203&action=review
> Source/WebCore/bindings/js/JSEventListener.cpp:281
> - return eventHandlerAttribute(target.attributeEventListener(eventType,
isolatedWorld), *target.scriptExecutionContext());
> + return eventHandlerAttribute(target.attributeEventListener(eventType,
isolatedWorld), target.scriptExecutionContext());
Why not just add the null check here? This is the only place where it can be
null.
auto context = target.scriptExecutionContext();
if (!context)
return jsNull();
More information about the webkit-reviews
mailing list