Bug 1170642 - Silence nsDocumentViewer::GetInImage warnings. r=ehsan
authorEric Rahm <erahm@mozilla.com>
Wed, 03 Jun 2015 08:22:04 -0700
changeset 247032 ac4e83862613dcdd2f61bda5bf5d1ecbd3eab7b2
parent 247031 1a41e3cf04b32b71086d377031e6e4065e30247e
child 247033 c0aa1d6f1ce4d19fab9add091936347382a3246a
push id28848
push userryanvm@gmail.com
push dateWed, 03 Jun 2015 20:00:13 +0000
treeherdermozilla-central@0920f2325a6d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1170642
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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