diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 407ff88687f..41186dd343c 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1253,7 +1253,9 @@ nsGfxScrollFrameInner::Layout(nsBoxLayoutState& aState) nsCOMPtr fm; presContext->GetMetricsFor(f, getter_AddRefs(fm)); nscoord fontHeight = 1; - fm->GetHeight(fontHeight); + NS_ASSERTION(fm,"FontMetrics is null assuming fontHeight == 1"); + if (fm) + fm->GetHeight(fontHeight); nscoord maxX = scrolledContentSize.width - scrollAreaRect.width; nscoord maxY = scrolledContentSize.height - scrollAreaRect.height; diff --git a/layout/html/base/src/nsGfxScrollFrame.cpp b/layout/html/base/src/nsGfxScrollFrame.cpp index 407ff88687f..41186dd343c 100644 --- a/layout/html/base/src/nsGfxScrollFrame.cpp +++ b/layout/html/base/src/nsGfxScrollFrame.cpp @@ -1253,7 +1253,9 @@ nsGfxScrollFrameInner::Layout(nsBoxLayoutState& aState) nsCOMPtr fm; presContext->GetMetricsFor(f, getter_AddRefs(fm)); nscoord fontHeight = 1; - fm->GetHeight(fontHeight); + NS_ASSERTION(fm,"FontMetrics is null assuming fontHeight == 1"); + if (fm) + fm->GetHeight(fontHeight); nscoord maxX = scrolledContentSize.width - scrollAreaRect.width; nscoord maxY = scrolledContentSize.height - scrollAreaRect.height;