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

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

Issue 1874973002: Fix font preload crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 3174db9c2d4fe40c4af611ad267f8fde9c93c1db..1f194811a1ba49e00728189d346ed50527c6b2c3 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -173,7 +173,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