Bug 1170642 - Silence nsDocumentViewer::GetInImage warnings. r=ehsan
authorEric Rahm <erahm@mozilla.com>
Wed, 03 Jun 2015 08:22:04 -0700
changeset 269690 ac4e83862613dcdd2f61bda5bf5d1ecbd3eab7b2
parent 269689 1a41e3cf04b32b71086d377031e6e4065e30247e
child 269691 c0aa1d6f1ce4d19fab9add091936347382a3246a
push id2540
push userwcosta@mozilla.com
push dateWed, 03 Jun 2015 20:55:41 +0000
reviewersehsan
bugs1170642
milestone41.0a1
Bug 1170642 - Silence nsDocumentViewer::GetInImage warnings. r=ehsan
layout/base/nsDocumentViewer.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -3530,17 +3530,19 @@ NS_IMETHODIMP nsDocumentViewer::GetInIma
 
   // we're not in an image unless i say so
   *aInImage = false;
 
   // get the popup image
   nsCOMPtr<nsIImageLoadingContent> node;
   nsresult rv = GetPopupImageNode(getter_AddRefs(node));
   if (NS_FAILED(rv)) return rv;
-  NS_ENSURE_TRUE(node, NS_ERROR_FAILURE);
+  if (!node) {
+    return NS_ERROR_FAILURE;
+  }
 
   // Make sure there is a URI assigned. This allows <input type="image"> to
   // be an image but rejects other <input> types. This matches what
   // nsContextMenu.js does.
   nsCOMPtr<nsIURI> uri;
   node->GetCurrentURI(getter_AddRefs(uri));
   if (uri) {
     // if we made it here, we're in an image