From 1b51c1fede75195ec46827669c30f638d6047544 Mon Sep 17 00:00:00 2001 From: "timeless%mac.com" Date: Tue, 15 May 2001 03:12:08 +0000 Subject: [PATCH] Bugzilla Bug 80634 Program received signal SIGSEGV, Segmentation fault. Bullet-proofing patch + ASSERT. rs=shaver --- layout/generic/nsGfxScrollFrame.cpp | 4 +++- layout/html/base/src/nsGfxScrollFrame.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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;