| Index: third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
|
| index 10c3665d7f81fa19c4a74df0672861de564d469d..4bf8c546801c00d1199a650c011a9898902ec592 100644
|
| --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
|
| @@ -1252,7 +1252,9 @@ void ContentSecurityPolicy::dispatchViolationEvents(
|
| const SecurityPolicyViolationEventInit& violationData,
|
| Element* element,
|
| Document* document) {
|
| - if (!document->domWindow())
|
| + // If the document is detached or closed (thus clearing its event queue)
|
| + // between the violation occuring and this event dispatch, exit early.
|
| + if (!document->domWindow() || !document->domWindow()->getEventQueue())
|
| return;
|
|
|
| SecurityPolicyViolationEvent* event = SecurityPolicyViolationEvent::create(
|
|
|