Title: [284195] trunk/Source/WebKit
Revision
284195
Author
timo...@apple.com
Date
2021-10-14 13:41:12 -0700 (Thu, 14 Oct 2021)

Log Message

Null check the context in -[WKWebProcessPlugInFrame jsContextForServiceWorkerWorld:]
https://bugs.webkit.org/show_bug.cgi?id=231758

Reviewed by Chris Dumez.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(-[WKWebProcessPlugInFrame jsContextForServiceWorkerWorld:]):
_frame->jsContextForServiceWorkerWorld() can return nullptr, so null check before using the result.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (284194 => 284195)


--- trunk/Source/WebKit/ChangeLog	2021-10-14 20:31:35 UTC (rev 284194)
+++ trunk/Source/WebKit/ChangeLog	2021-10-14 20:41:12 UTC (rev 284195)
@@ -1,3 +1,14 @@
+2021-10-14  Timothy Hatcher  <timo...@apple.com>
+
+        Null check the context in -[WKWebProcessPlugInFrame jsContextForServiceWorkerWorld:]
+        https://bugs.webkit.org/show_bug.cgi?id=231758
+
+        Reviewed by Chris Dumez.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
+        (-[WKWebProcessPlugInFrame jsContextForServiceWorkerWorld:]):
+        _frame->jsContextForServiceWorkerWorld() can return nullptr, so null check before using the result.
+
 2021-10-14  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         All the SDKVariant.xcconfig files should match

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm (284194 => 284195)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm	2021-10-14 20:31:35 UTC (rev 284194)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm	2021-10-14 20:41:12 UTC (rev 284195)
@@ -73,7 +73,9 @@
 
 - (JSContext *)jsContextForServiceWorkerWorld:(WKWebProcessPlugInScriptWorld *)world
 {
-    return [JSContext contextWithJSGlobalContextRef:_frame->jsContextForServiceWorkerWorld(&[world _scriptWorld])];
+    if (auto context = _frame->jsContextForServiceWorkerWorld(&[world _scriptWorld]))
+        return [JSContext contextWithJSGlobalContextRef:context];
+    return nil;
 }
 
 - (WKWebProcessPlugInHitTestResult *)hitTest:(CGPoint)point
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to