Bug 1511012 - [1.0] Ensure non-null scheme before accessing it. r=droeh
authorEugen Sawin <esawin@mozilla.com>
Thu, 29 Nov 2018 22:06:32 +0000
changeset 505309 ea4b9bbb0cf49ff47f18427132141e42f71982ee
parent 505308 863959eb64d1f39ad7c07e44f98263ee10d6ef5a
child 505310 6b447ab87004213505fbdcb0d2538a2634550737
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdroeh
bugs1511012
milestone65.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 1511012 - [1.0] Ensure non-null scheme before accessing it. r=droeh Differential Revision: https://phabricator.services.mozilla.com/D13455
mobile/android/base/java/org/mozilla/gecko/webapps/WebApps.java
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebApps.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebApps.java
@@ -68,16 +68,19 @@ public final class WebApps {
 
     @Nullable
     public static Uri getValidURL(@NonNull String urlString) {
         final Uri uri = Uri.parse(urlString);
         if (uri == null) {
             return null;
         }
         final String scheme = uri.getScheme();
+        if (scheme == null) {
+            return null;
+        }
         // currently we only support http and https to open in Firefox
         if (scheme.equals("http") || scheme.equals("https")) {
             return uri;
         } else {
             return null;
         }
     }
 }