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 94367f965e8f7bd2276f44c57496b08011ce3316..2bef27e76e580e7c90839ac791d3a713817daad5 100644 |
--- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp |
+++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp |
@@ -1264,6 +1264,9 @@ void ContentSecurityPolicy::dispatchViolationEvents( |
const SecurityPolicyViolationEventInit& violationData, |
Element* element, |
Document* document) { |
+ if (!document->domWindow()) |
+ return; |
+ |
SecurityPolicyViolationEvent* event = SecurityPolicyViolationEvent::create( |
EventTypeNames::securitypolicyviolation, violationData); |
DCHECK(event->bubbles()); |