Bug 231758

Summary: Null check the context in -[WKWebProcessPlugInFrame jsContextForServiceWorkerWorld:]
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: WebKit APIAssignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Timothy Hatcher 2021-10-14 12:33:19 PDT
_frame->jsContextForServiceWorkerWorld() can return nullptr, so we should null check before using the result.
Comment 1 Timothy Hatcher 2021-10-14 12:37:45 PDT
Created attachment 441257 [details]
Patch
Comment 2 Chris Dumez 2021-10-14 12:38:25 PDT
Comment on attachment 441257 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=441257&action=review

> Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:76
> +    if (JSGlobalContextRef context = _frame->jsContextForServiceWorkerWorld(&[world _scriptWorld]))

auto
Comment 3 Timothy Hatcher 2021-10-14 12:40:57 PDT
Created attachment 441259 [details]
Patch
Comment 4 EWS 2021-10-14 13:41:21 PDT
Committed r284195 (243009@main): <https://commits.webkit.org/243009@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 441259 [details].
Comment 5 Radar WebKit Bug Importer 2021-10-14 13:42:18 PDT
<rdar://problem/84272222>