Bug 1057866 - Handle null callbacks in ChromeCast code. r=mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Mon, 25 Aug 2014 16:19:27 -0700
changeset 223187 7f82db190a847812f9551e09447759985afa68f7
parent 223186 8f00edcf296251c514d128b8391ba4b404d1009b
child 223188 e12e303547c03bae6ff1f0d7608d586233ce5271
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1057866
milestone34.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 1057866 - Handle null callbacks in ChromeCast code. r=mfinkle
mobile/android/base/ChromeCast.java
--- a/mobile/android/base/ChromeCast.java
+++ b/mobile/android/base/ChromeCast.java
@@ -220,25 +220,30 @@ class ChromeCast implements GeckoMediaPl
     }
 
     public void stop(final EventCallback callback) {
         // Nothing to be done here
         callback.sendSuccess(null);
     }
 
     public boolean verifySession(final EventCallback callback) {
+        String msg = null;
         if (apiClient == null || !apiClient.isConnected()) {
-            debug("Can't play. No connection");
-            callback.sendError("Not connected");
-            return false;
+            msg = "Not connected";
         }
 
         if (mSessionId == null) {
-            debug("Can't play. No session");
-            callback.sendError("No session");
+            msg = "No session";
+        }
+
+        if (msg != null) {
+            debug(msg);
+            if (callback != null) {
+                callback.sendError(msg);
+            }
             return false;
         }
 
         return true;
     }
 
     public void play(final EventCallback callback) {
         if (!verifySession(callback)) {