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

Unified Diff: sky/engine/core/html/imports/HTMLImportLoader.cpp

Issue 682913002: Don't crash when importing a 404 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « sky/engine/bindings/core/v8/ScriptController.cpp ('k') | sky/tests/modules/imports-can-load-404s.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/html/imports/HTMLImportLoader.cpp
diff --git a/sky/engine/core/html/imports/HTMLImportLoader.cpp b/sky/engine/core/html/imports/HTMLImportLoader.cpp
index a96b38566d3d8585355e4dbf303b73841ae0542a..22e5b599bc106dc1a677dbc5a99b187963a78ad9 100644
--- a/sky/engine/core/html/imports/HTMLImportLoader.cpp
+++ b/sky/engine/core/html/imports/HTMLImportLoader.cpp
@@ -121,8 +121,10 @@ void HTMLImportLoader::setState(State state)
m_state = state;
- if (m_state == StateParsed || m_state == StateError || m_state == StateWritten)
- m_document->cancelParsing();
+ if (m_state == StateParsed || m_state == StateError || m_state == StateWritten) {
+ if (m_document)
+ m_document->cancelParsing();
+ }
// Since DocumentWriter::end() can let setState() reenter, we shouldn't refer to m_state here.
if (state == StateLoaded || state == StateError)
« no previous file with comments | « sky/engine/bindings/core/v8/ScriptController.cpp ('k') | sky/tests/modules/imports-can-load-404s.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698