Index: Source/core/loader/LinkLoader.cpp |
diff --git a/Source/core/loader/LinkLoader.cpp b/Source/core/loader/LinkLoader.cpp |
index 054b982c7e637049f7476408e64f4e41ebccfb3f..1a5a0f671428bf788c04d96e15a823bf888efea3 100644 |
--- a/Source/core/loader/LinkLoader.cpp |
+++ b/Source/core/loader/LinkLoader.cpp |
@@ -132,7 +132,8 @@ static void preconnectIfNeeded(const LinkRelAttribute& relAttribute, const KURL& |
{ |
if (relAttribute.isPreconnect() && href.isValid()) { |
ASSERT(RuntimeEnabledFeatures::linkPreconnectEnabled()); |
- if (document.settings()->logDnsPrefetchAndPreconnect()) |
+ Settings* settings = document.settings(); |
+ if (settings && settings->logDnsPrefetchAndPreconnect()) |
document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource, DebugMessageLevel, String("Preconnect triggered for " + href.host()))); |
preconnect(href); |
} |
@@ -163,7 +164,8 @@ void LinkLoader::preloadIfNeeded(const LinkRelAttribute& relAttribute, const KUR |
return; |
} |
FetchRequest linkRequest(ResourceRequest(document.completeURL(href)), FetchInitiatorTypeNames::link); |
- if (document.settings()->logPreload()) |
+ Settings* settings = document.settings(); |
+ if (settings && settings->logPreload()) |
document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource, DebugMessageLevel, String("Preload triggered for " + href.host() + href.path()))); |
setResource(document.fetcher()->fetchLinkPreloadResource(type, linkRequest)); |
} |