From c4cf269ebe4353c1bf54c45ec96693201c14cc86 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 28 Dec 2009 14:47:27 -0500 Subject: [PATCH] Bug 536931. Check whether we found a content node before trying to get its primary frame. r=dbaron --- layout/xul/base/src/crashtests/536931-1.xhtml | 4 ++++ layout/xul/base/src/crashtests/crashtests.list | 1 + layout/xul/base/src/nsListBoxObject.cpp | 3 +++ 3 files changed, 8 insertions(+) create mode 100644 layout/xul/base/src/crashtests/536931-1.xhtml diff --git a/layout/xul/base/src/crashtests/536931-1.xhtml b/layout/xul/base/src/crashtests/536931-1.xhtml new file mode 100644 index 00000000000..6f3fc1396a5 --- /dev/null +++ b/layout/xul/base/src/crashtests/536931-1.xhtml @@ -0,0 +1,4 @@ + + + + diff --git a/layout/xul/base/src/crashtests/crashtests.list b/layout/xul/base/src/crashtests/crashtests.list index ce9fef2f6be..0ce1d8b6b15 100644 --- a/layout/xul/base/src/crashtests/crashtests.list +++ b/layout/xul/base/src/crashtests/crashtests.list @@ -67,3 +67,4 @@ load 488210-1.xhtml load 495728-1.xul load 508927-1.xul load 508927-2.xul +load 536931-1.xhtml diff --git a/layout/xul/base/src/nsListBoxObject.cpp b/layout/xul/base/src/nsListBoxObject.cpp index ee623c217b5..b4c9222c338 100644 --- a/layout/xul/base/src/nsListBoxObject.cpp +++ b/layout/xul/base/src/nsListBoxObject.cpp @@ -202,6 +202,9 @@ nsListBoxObject::GetListBoxBody(PRBool aFlush) nsCOMPtr content; FindBodyContent(frame->GetContent(), getter_AddRefs(content)); + if (!content) + return nsnull; + // this frame will be a nsGFXScrollFrame frame = content->GetPrimaryFrame(); if (!frame)