Bug 1145892 - Add null check in ShareDialog.handleSendTabUIEvent. r=rnewman
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 20 Mar 2015 16:30:05 -0700
changeset 265333 ad46c4efdc6ba27cb029adc5a5c926be7366f012
parent 265332 35d17c53d9d13304b2555168491d4d883c9db423
child 265334 eb81a63a0102dbe4024e02522bf6cb32c86a561f
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)
reviewersrnewman
bugs1145892
milestone39.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 1145892 - Add null check in ShareDialog.handleSendTabUIEvent. r=rnewman
mobile/android/base/overlays/ui/ShareDialog.java
--- a/mobile/android/base/overlays/ui/ShareDialog.java
+++ b/mobile/android/base/overlays/ui/ShareDialog.java
@@ -101,17 +101,18 @@ public class ShareDialog extends Locales
     protected void handleSendTabUIEvent(Intent intent) {
         sendTabOverrideIntent = intent.getParcelableExtra(SendTab.OVERRIDE_INTENT);
 
         ParcelableClientRecord[] clientrecords = (ParcelableClientRecord[]) intent.getParcelableArrayExtra(SendTab.EXTRA_CLIENT_RECORDS);
 
         // Escape hatch: we don't show the option to open this dialog in this state so this should
         // never be run. However, due to potential inconsistencies in synced client state
         // (e.g. bug 1122302 comment 47), we might fail.
-        if (state == State.DEVICES_ONLY && clientrecords.length == 0) {
+        if (state == State.DEVICES_ONLY &&
+                (clientrecords == null || clientrecords.length == 0)) {
             Log.e(LOGTAG, "In state: " + State.DEVICES_ONLY + " and received 0 synced clients. Finishing...");
             Toast.makeText(this, getResources().getText(R.string.overlay_no_synced_devices), Toast.LENGTH_SHORT)
                  .show();
             finish();
             return;
         }
 
         sendTabList.setSyncClients(clientrecords);