Index: Source/core/html/parser/HTMLDocumentParser.cpp |
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp |
index 0393a681370b2feae2fe2bb370799479a176539d..190991b79453c74ffd9dac9779efcde939c56ca1 100644 |
--- a/Source/core/html/parser/HTMLDocumentParser.cpp |
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp |
@@ -743,8 +743,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; |