Bug 926129 - Follow-up: null check. r=trivial
authorRichard Newman <rnewman@mozilla.com>
Sat, 12 Oct 2013 22:32:03 -0700
changeset 164404 80f6c958c74ccac593401740671ecea381e29cbf
parent 164403 f42cbf37529471f6f0d62341864bdacc65c7db68
child 164405 cd87799152880df2227c14be2680d27e101ceccf
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstrivial
bugs926129
milestone27.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 926129 - Follow-up: null check. r=trivial
mobile/android/base/favicons/LoadFaviconTask.java
--- a/mobile/android/base/favicons/LoadFaviconTask.java
+++ b/mobile/android/base/favicons/LoadFaviconTask.java
@@ -360,17 +360,23 @@ public class LoadFaviconTask extends UiA
         synchronized(loadsInFlight) {
             // Only remove from the hashmap if the task there is the one that's being canceled.
             // Cancellation of a task that would have chained is not interesting to the hashmap.
             final LoadFaviconTask primary = loadsInFlight.get(mFaviconUrl);
             if (primary == this) {
                 loadsInFlight.remove(mFaviconUrl);
                 return;
             }
-            primary.mChainees.remove(this);
+            if (primary == null) {
+                // This shouldn't happen.
+                return;
+            }
+            if (primary.mChainees != null) {
+              primary.mChainees.remove(this);
+            }
         }
 
         // Note that we don't call the listener callback if the
         // favicon load is cancelled.
     }
 
     /**
      * When the result of this job is ready, also notify the chainee of the result.