Bug 505835. nsTreeBodyFrame::ReflowFinished should null check return value of GetBaseElement. r=neil
authorTimothy Nikkel <tnikkel@gmail.com>
Sat, 10 Apr 2010 13:03:40 -0500
changeset 40765 5b0bd6f3ddf9c7b03a0c9bee508513643323c2f6
parent 40764 74a560d813ae3afe96c4a39f46b3978bcf089755
child 40766 8df1936a0f3d2626c37c4a37203d255c384290cd
push idunknown
push userunknown
push dateunknown
reviewersneil
bugs505835
milestone1.9.3a5pre
Bug 505835. nsTreeBodyFrame::ReflowFinished should null check return value of GetBaseElement. r=neil
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -438,17 +438,18 @@ nsTreeBodyFrame::ReflowFinished()
       mPageLength = mInnerBox.height / mRowHeight;
     }
 
     PRInt32 lastPageTopRow = NS_MAX(0, mRowCount - mPageLength);
     if (mTopRowIndex > lastPageTopRow)
       ScrollToRowInternal(parts, lastPageTopRow);
 
     nsIContent *treeContent = GetBaseElement();
-    if (treeContent->AttrValueIs(kNameSpaceID_None,
+    if (treeContent &&
+        treeContent->AttrValueIs(kNameSpaceID_None,
                                  nsGkAtoms::keepcurrentinview,
                                  nsGkAtoms::_true, eCaseMatters)) {
       // make sure that the current selected item is still
       // visible after the tree changes size.
       nsCOMPtr<nsITreeSelection> sel;
       mView->GetSelection(getter_AddRefs(sel));
       if (sel) {
         PRInt32 currentIndex;