From 895c5552eccb015eadb3dc82c2a87e923458e855 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 8 Apr 2015 13:01:38 +1000 Subject: [PATCH] Bug 1152023 - Null check root frame when marking frames dirty in response to a user font load. r=jdaggett --- layout/base/nsPresContext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index f5fbe93a693f..dbed541151a1 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -2184,7 +2184,10 @@ nsPresContext::UserFontSetUpdated(gfxUserFontEntry* aUpdatedFont) // it contains that specific font (i.e. the one chosen within the family // given the weight, width, and slant from the nsStyleFont). If it does, // mark that frame dirty and skip inspecting its descendants. - nsFontFaceUtils::MarkDirtyForFontChange(mShell->GetRootFrame(), aUpdatedFont); + nsIFrame* root = mShell->GetRootFrame(); + if (root) { + nsFontFaceUtils::MarkDirtyForFontChange(root, aUpdatedFont); + } } FontFaceSet*