r=brade, sr=kin, a=asa
domSelection can be null if there is no presShell - don't dereference it
This commit is contained in:
mkaply%us.ibm.com 2003-02-06 05:34:47 +00:00
Родитель 82345876f3
Коммит 6e53484b55
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -368,13 +368,15 @@ nsComposerCommandsUpdater::SelectionIsCollapsed()
if (!mDOMWindow) return PR_TRUE; if (!mDOMWindow) return PR_TRUE;
nsCOMPtr<nsISelection> domSelection; nsCOMPtr<nsISelection> domSelection;
if (NS_SUCCEEDED(mDOMWindow->GetSelection(getter_AddRefs(domSelection)))) if (NS_SUCCEEDED(mDOMWindow->GetSelection(getter_AddRefs(domSelection))) && domSelection)
{ {
PRBool selectionCollapsed = PR_FALSE; PRBool selectionCollapsed = PR_FALSE;
domSelection->GetIsCollapsed(&selectionCollapsed); domSelection->GetIsCollapsed(&selectionCollapsed);
return selectionCollapsed; return selectionCollapsed;
} }
NS_WARNING("nsComposerCommandsUpdater::SelectionIsCollapsed - no domSelection");
return PR_FALSE; return PR_FALSE;
} }