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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 1867493002: Fix font preload crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/LayoutTests/http/tests/preload/preload-csp.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/DocumentLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index e9498218cf2fbbd83ea56c8714a1b73c3f1ba69c..80bca0bc223ff9bb0e45494c21ea7d7f22c7b4fe 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -180,7 +180,8 @@ Resource* DocumentLoader::startPreload(Resource::Type type, FetchRequest& reques
case Resource::Font:
resource = FontResource::fetch(request, fetcher());
// This is needed for fonts as loading doesn't start until there's usage.
- toFontResource(resource)->beginLoadIfNeeded(fetcher());
+ if (resource)
+ toFontResource(resource)->beginLoadIfNeeded(fetcher());
break;
case Resource::Media:
resource = RawResource::fetchMedia(request, fetcher());
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/preload/preload-csp.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698