mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 13:45:46 +00:00
r=brade, sr=kin, a=asa domSelection can be null if there is no presShell - don't dereference it
This commit is contained in:
parent
5cc66223d8
commit
8722e3bb55
@ -368,13 +368,15 @@ nsComposerCommandsUpdater::SelectionIsCollapsed()
|
||||
if (!mDOMWindow) return PR_TRUE;
|
||||
|
||||
nsCOMPtr<nsISelection> domSelection;
|
||||
if (NS_SUCCEEDED(mDOMWindow->GetSelection(getter_AddRefs(domSelection))))
|
||||
{
|
||||
if (NS_SUCCEEDED(mDOMWindow->GetSelection(getter_AddRefs(domSelection))) && domSelection)
|
||||
{
|
||||
PRBool selectionCollapsed = PR_FALSE;
|
||||
domSelection->GetIsCollapsed(&selectionCollapsed);
|
||||
return selectionCollapsed;
|
||||
}
|
||||
|
||||
NS_WARNING("nsComposerCommandsUpdater::SelectionIsCollapsed - no domSelection");
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user