Bug 1148832 - Return early from nsAlertsIconListener::OnLoadComplete if the image has an error. r=baku, a=sledru
authorSeth Fowler <mark.seth.fowler@gmail.com>
Tue, 07 Apr 2015 16:44:29 -0700
changeset 258402 bf83a8535bf4
parent 258401 881a59941b04
child 258403 bbbb9f84cf98
push id4659
push userryanvm@gmail.com
push date2015-04-09 15:23 +0000
treeherdermozilla-beta@58dca3f7560a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku, sledru
bugs1148832
milestone38.0
Bug 1148832 - Return early from nsAlertsIconListener::OnLoadComplete if the image has an error. r=baku, a=sledru
toolkit/system/gnome/nsAlertsIconListener.cpp
--- a/toolkit/system/gnome/nsAlertsIconListener.cpp
+++ b/toolkit/system/gnome/nsAlertsIconListener.cpp
@@ -132,17 +132,19 @@ nsAlertsIconListener::OnLoadComplete(img
 
     // Cancel any pending request
     mIconRequest->Cancel(NS_BINDING_ABORTED);
     mIconRequest = nullptr;
   }
 
   nsCOMPtr<imgIContainer> image;
   rv = aRequest->GetImage(getter_AddRefs(image));
-  MOZ_ASSERT(image);
+  if (NS_WARN_IF(NS_FAILED(rv) || !image)) {
+    return rv;
+  }
 
   // Ask the image to decode at its intrinsic size.
   int32_t width = 0, height = 0;
   image->GetWidth(&width);
   image->GetHeight(&height);
   image->RequestDecodeForSize(nsIntSize(width, height), imgIContainer::FLAG_NONE);
 
   return NS_OK;