From 750289cdf93c136ebe1a11b8d236c7dc6d4a3cfd Mon Sep 17 00:00:00 2001 From: "Olli.Pettay@helsinki.fi" Date: Tue, 25 Sep 2007 00:12:36 -0700 Subject: [PATCH] Bug 397304, [@ nsListBoxBodyFrame::GetAvailableHeight], r+sr=bz, a=roc --- layout/xul/base/src/nsListBoxBodyFrame.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/layout/xul/base/src/nsListBoxBodyFrame.cpp b/layout/xul/base/src/nsListBoxBodyFrame.cpp index 5632c9d92fab..1ec60bcf488e 100644 --- a/layout/xul/base/src/nsListBoxBodyFrame.cpp +++ b/layout/xul/base/src/nsListBoxBodyFrame.cpp @@ -730,8 +730,11 @@ nsListBoxBodyFrame::GetAvailableHeight() { nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(this); - nsIScrollableView* scrollView = scrollFrame->GetScrollableView(); - return scrollView->View()->GetBounds().height; + if (scrollFrame) { + nsIScrollableView* scrollView = scrollFrame->GetScrollableView(); + return scrollView->View()->GetBounds().height; + } + return 0; } nscoord @@ -1011,6 +1014,9 @@ nsListBoxBodyFrame::VerticalScroll(PRInt32 aPosition) { nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(this); + if (!scrollFrame) { + return; + } nsPoint scrollPosition = scrollFrame->GetScrollPosition();