Bug 1184289 - Remove a spammy editor warning
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 08 Aug 2015 18:23:40 -0400
changeset 256981 b8731f7d5b7bd930b97511f82a96a5be0924e61b
parent 256980 1ec4867e4e8c0c5acb59a8d8d9b1f85b1b6def90
child 256982 dfda5e6a87c894a14b03f30cfa9dd5709b8ba0be
push idunknown
push userunknown
push dateunknown
bugs1184289
milestone42.0a1
Bug 1184289 - Remove a spammy editor warning
editor/libeditor/nsEditor.cpp
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -622,17 +622,19 @@ nsEditor::GetSelectionController(nsISele
   *aSel = nullptr; // init out param
   nsCOMPtr<nsISelectionController> selCon;
   if (mSelConWeak) {
     selCon = do_QueryReferent(mSelConWeak);
   } else {
     nsCOMPtr<nsIPresShell> presShell = GetPresShell();
     selCon = do_QueryInterface(presShell);
   }
-  NS_ENSURE_TRUE(selCon, NS_ERROR_NOT_INITIALIZED);
+  if (!selCon) {
+    return NS_ERROR_NOT_INITIALIZED;
+  }
   NS_ADDREF(*aSel = selCon);
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsEditor::DeleteSelection(EDirection aAction, EStripWrappers aStripWrappers)
 {