Bug 720509 - Add null check for URI scheme in options menu. r=mfinkle
authorBrian Nicholson <bnicholson@mozilla.com>
Fri, 10 Feb 2012 10:40:05 -0800
changeset 86628 331973a3884e0800bf8e3912574dbbdc9d4bb96a
parent 86627 83e4a240abc0735e37d9fb6cbf442720a3e93f66
child 86629 1c3efb9a3fed5da2d05218d36fb76f9889c06dfb
push idunknown
push userunknown
push dateunknown
reviewersmfinkle
bugs720509
milestone13.0a1
Bug 720509 - Add null check for URI scheme in options menu. r=mfinkle
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -452,18 +452,18 @@ abstract public class GeckoApp
             bookmark.setChecked(false);
             bookmark.setIcon(R.drawable.ic_menu_bookmark_add);
         }
 
         forward.setEnabled(tab.canDoForward());
 
         // Disable share menuitem for about:, chrome: and file: URIs
         String scheme = Uri.parse(tab.getURL()).getScheme();
-        boolean enabled = !(scheme.equals("about") || scheme.equals("chrome") ||
-                            scheme.equals("file"));
+        boolean enabled = scheme != null && !(scheme.equals("about") || scheme.equals("chrome") ||
+                                              scheme.equals("file"));
         share.setEnabled(enabled);
 
         // Disable save as PDF for about:home and xul pages
         saveAsPDF.setEnabled(!(tab.getURL().equals("about:home") ||
                                tab.getContentType().equals("application/vnd.mozilla.xul+xml")));
 
         // DownloadManager support is tied to level 12 and higher
         if (Build.VERSION.SDK_INT < 12)