Bug 1061685: Don't crash when we get a share with no URL r=rnewman
authorChris Kitching <chriskitching@linux.com>
Tue, 02 Sep 2014 16:29:12 -0700
changeset 218675 ed3c169b4fb6d4609557e0cdec792c2e5f612c05
parent 218674 3459b37cdd2f0b9e02df7c74c01a4298d265bd71
child 218676 b0c0a3322e3668ffd146954108e4fa443cf192cc
push id7107
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 17:43:31 +0000
treeherdermozilla-aurora@b4b34e0acc75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1061685
milestone35.0a1
Bug 1061685: Don't crash when we get a share with no URL 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
@@ -98,16 +98,17 @@ public class ShareDialog extends LocaleA
 
         if (TextUtils.isEmpty(pageUrl)) {
             Log.e(LOGTAG, "Unable to process shared intent. No URL found!");
 
             // Display toast notifying the user of failure (most likely a developer who screwed up
             // trying to send a share intent).
             Toast toast = Toast.makeText(this, getResources().getText(R.string.overlay_share_no_url), Toast.LENGTH_SHORT);
             toast.show();
+            finish();
 
             return;
         }
 
         setContentView(R.layout.overlay_share_dialog);
 
         LocalBroadcastManager.getInstance(this).registerReceiver(uiEventListener,
                                                                  new IntentFilter(OverlayConstants.SHARE_METHOD_UI_EVENT));