From be87817fb022a57fcc11345c2669d956cb7aa4dd Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Fri, 5 Nov 1999 21:51:42 +0000 Subject: [PATCH] fix for #17763 - initialize cellFrame so that if it's not found, the null check succeeds r=hyatt a=chofmann git-svn-id: svn://10.0.0.236/trunk@52866 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/xul/base/src/nsTreeFrame.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mozilla/layout/xul/base/src/nsTreeFrame.cpp b/mozilla/layout/xul/base/src/nsTreeFrame.cpp index 5e6800783f2..0187b7fbd7b 100644 --- a/mozilla/layout/xul/base/src/nsTreeFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTreeFrame.cpp @@ -74,9 +74,11 @@ void nsTreeFrame::SetSelection(nsIPresContext& aPresContext, nsTreeCellFrame* aF nsCOMPtr cellContent; aFrame->GetContent(getter_AddRefs(cellContent)); + if (!cellContent) return; nsCOMPtr rowContent; cellContent->GetParent(*getter_AddRefs(rowContent)); + if (!rowContent) return; nsCOMPtr itemContent; rowContent->GetParent(*getter_AddRefs(itemContent)); @@ -210,7 +212,7 @@ nsTreeFrame::HandleEvent(nsIPresContext& aPresContext, treeRowGroup->EnsureRowIsVisible(rowIndex); // Now that the row is scrolled into view, we have a frame created. We can retrieve the cell. - nsTreeCellFrame* cellFrame; + nsTreeCellFrame* cellFrame=nsnull; treeRowGroup->GetCellFrameAtIndex(rowIndex, cellIndex, &cellFrame); if (!cellFrame) return NS_OK; // No cell. Whatever. Bail.