Index: Source/core/html/parser/HTMLDocumentParser.cpp |
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp |
index 3d7d7a47589d0683200fadf6df8065cd30e5d01b..6550314ea84dcfcda1d5c7d343b5027dd2216d9a 100644 |
--- a/Source/core/html/parser/HTMLDocumentParser.cpp |
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp |
@@ -744,8 +744,10 @@ void HTMLDocumentParser::startBackgroundParser() |
m_backgroundParser = WeakPtr<BackgroundHTMLParser>(reference); |
// TODO(oysteine): Disabled due to crbug.com/398076 until a full fix can be implemented. |
- if (RuntimeEnabledFeatures::threadedParserDataReceiverEnabled()) |
- document()->loader()->attachThreadedDataReceiver(adoptPtr(new ParserDataReceiver(m_backgroundParser))); |
+ if (RuntimeEnabledFeatures::threadedParserDataReceiverEnabled()) { |
+ if (DocumentLoader* loader = document()->loader()) |
+ loader->attachThreadedDataReceiver(adoptPtr(new ParserDataReceiver(m_backgroundParser))); |
+ } |
OwnPtr<BackgroundHTMLParser::Configuration> config = adoptPtr(new BackgroundHTMLParser::Configuration); |
config->options = m_options; |