fix crash clicking away from and back to virtual folder while search going on, sr=mscott, a=asa 273560

This commit is contained in:
bienvenu%nventure.com 2005-04-20 21:25:45 +00:00
parent e1d07d3708
commit f7c040c36c

View File

@ -803,7 +803,7 @@ nsresult nsMsgDBView::SaveAndClearSelection(nsMsgKey *aCurrentMsgKey, nsMsgKeyAr
if (m_saveRestoreSelectionDepth != 1)
return NS_OK;
if (!mTreeSelection)
if (!mTreeSelection || !mTree)
return NS_OK;
// first, freeze selection.
@ -876,6 +876,7 @@ nsresult nsMsgDBView::RestoreSelection(nsMsgKey aCurrentMsgKey, nsMsgKeyArray *a
if (aCurrentMsgKey != nsMsgKey_None)
currentViewPosition = FindKey(aCurrentMsgKey, PR_TRUE);
if (mTree)
mTreeSelection->SetCurrentIndex(currentViewPosition);
// make sure the current message is once again visible in the thread pane