diff --git a/editor/composer/src/nsComposerCommandsUpdater.cpp b/editor/composer/src/nsComposerCommandsUpdater.cpp index 2e43d229702..988aa19bcf6 100644 --- a/editor/composer/src/nsComposerCommandsUpdater.cpp +++ b/editor/composer/src/nsComposerCommandsUpdater.cpp @@ -368,13 +368,15 @@ nsComposerCommandsUpdater::SelectionIsCollapsed() if (!mDOMWindow) return PR_TRUE; nsCOMPtr 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; }