Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Unified Diff: Source/core/inspector/DOMPatchSupport.cpp

Issue 729453003: DevTools: Fix crash when setting invalid outer XML for an XML document (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/inspector/DOMPatchSupport.cpp
diff --git a/Source/core/inspector/DOMPatchSupport.cpp b/Source/core/inspector/DOMPatchSupport.cpp
index 9708d9671ef630af589c9776f11745de8b1ea04c..8387f92780b1a1706d70b6a43ec7ec6638443d1c 100644
--- a/Source/core/inspector/DOMPatchSupport.cpp
+++ b/Source/core/inspector/DOMPatchSupport.cpp
@@ -102,6 +102,10 @@ void DOMPatchSupport::patchDocument(const String& markup)
parser->finish();
parser->detach();
+ // Check if the new markup has been parsed successfully.
+ if (!newDocument->documentElement())
+ return;
+
OwnPtr<Digest> oldInfo = createDigest(document().documentElement(), 0);
OwnPtr<Digest> newInfo = createDigest(newDocument->documentElement(), &m_unusedNodesMap);

Powered by Google App Engine
This is Rietveld 408576698