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 266952 f30e59dc03c365cd0285efabdb73792ecf87c532
parent 266951 a6f8ea1578689e91b7f6ff5ab02b5800b3bc92a9
child 266953 6b53fb4054722e0ef2b51750f76f78de4a2be526
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku, sledru
bugs1148832
milestone39.0a2
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;