Index: third_party/WebKit/Source/core/xml/DOMParser.cpp |
diff --git a/third_party/WebKit/Source/core/xml/DOMParser.cpp b/third_party/WebKit/Source/core/xml/DOMParser.cpp |
index 9bec141914aff5f4600b4304165c26f4243d8bb0..98a2a5bef7479c35e59885685210654957238ccc 100644 |
--- a/third_party/WebKit/Source/core/xml/DOMParser.cpp |
+++ b/third_party/WebKit/Source/core/xml/DOMParser.cpp |
@@ -28,7 +28,8 @@ Document* DOMParser::parseFromString(const String& str, const String& type) { |
Document* doc = DOMImplementation::createDocument( |
type, DocumentInit(KURL(), nullptr, m_contextDocument), false); |
doc->setContent(str); |
- doc->setSecurityOrigin(m_contextDocument->getSecurityOrigin()); |
+ if (m_contextDocument) |
+ doc->setSecurityOrigin(m_contextDocument->getSecurityOrigin()); |
return doc; |
} |