Bug 1184689 - Remove two spammy editor warnings

This commit is contained in:
Ehsan Akhgari 2015-08-10 23:48:52 -04:00
parent b2e59d9512
commit 383dae82b6

View File

@ -656,7 +656,9 @@ nsEditor::GetSelection(int16_t aSelectionType, nsISelection** aSelection)
*aSelection = nullptr;
nsCOMPtr<nsISelectionController> selcon;
GetSelectionController(getter_AddRefs(selcon));
NS_ENSURE_TRUE(selcon, NS_ERROR_NOT_INITIALIZED);
if (!selcon) {
return NS_ERROR_NOT_INITIALIZED;
}
return selcon->GetSelection(aSelectionType, aSelection); // does an addref
}
@ -665,7 +667,9 @@ nsEditor::GetSelection(int16_t aSelectionType)
{
nsCOMPtr<nsISelection> sel;
nsresult res = GetSelection(aSelectionType, getter_AddRefs(sel));
NS_ENSURE_SUCCESS(res, nullptr);
if (NS_FAILED(res)) {
return nullptr;
}
return static_cast<Selection*>(sel.get());
}