From 38d72c6dc7969ff46ecbe76fa1f5dc1aedee0e1e Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Fri, 27 Jul 2001 21:37:27 +0000 Subject: [PATCH] fix for #92191. crash in subscribe dialog (which uses outliner). r=hwaara, sr=hyatt, a=dbaron for 0.9.3 git-svn-id: svn://10.0.0.236/trunk@99988 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/outliner/src/nsOutlinerBodyFrame.cpp | 22 ++++++++++--------- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 22 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp index f8f69aeb272..1e9fd88c2ed 100644 --- a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp @@ -1210,17 +1210,19 @@ nsOutlinerBodyFrame::PrefillPropertyArray(PRInt32 aRowIndex, nsOutlinerColumn* a nsCOMPtr selection; mView->GetSelection(getter_AddRefs(selection)); - // selected - PRBool isSelected; - selection->IsSelected(aRowIndex, &isSelected); - if (isSelected) - mScratchArray->AppendElement(nsHTMLAtoms::selected); + if (selection) { + // selected + PRBool isSelected; + selection->IsSelected(aRowIndex, &isSelected); + if (isSelected) + mScratchArray->AppendElement(nsHTMLAtoms::selected); - // current - PRInt32 currentIndex; - selection->GetCurrentIndex(¤tIndex); - if (aRowIndex == currentIndex) - mScratchArray->AppendElement(nsXULAtoms::current); + // current + PRInt32 currentIndex; + selection->GetCurrentIndex(¤tIndex); + if (aRowIndex == currentIndex) + mScratchArray->AppendElement(nsXULAtoms::current); + } // container or leaf PRBool isContainer = PR_FALSE; diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index f8f69aeb272..1e9fd88c2ed 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -1210,17 +1210,19 @@ nsOutlinerBodyFrame::PrefillPropertyArray(PRInt32 aRowIndex, nsOutlinerColumn* a nsCOMPtr selection; mView->GetSelection(getter_AddRefs(selection)); - // selected - PRBool isSelected; - selection->IsSelected(aRowIndex, &isSelected); - if (isSelected) - mScratchArray->AppendElement(nsHTMLAtoms::selected); + if (selection) { + // selected + PRBool isSelected; + selection->IsSelected(aRowIndex, &isSelected); + if (isSelected) + mScratchArray->AppendElement(nsHTMLAtoms::selected); - // current - PRInt32 currentIndex; - selection->GetCurrentIndex(¤tIndex); - if (aRowIndex == currentIndex) - mScratchArray->AppendElement(nsXULAtoms::current); + // current + PRInt32 currentIndex; + selection->GetCurrentIndex(¤tIndex); + if (aRowIndex == currentIndex) + mScratchArray->AppendElement(nsXULAtoms::current); + } // container or leaf PRBool isContainer = PR_FALSE;