Bug 1527648 - Uid deeplink nullpointer check. r=petru, a=lizzard
authorVlad Baicu <vlad.baicu@softvision.ro>
Tue, 19 Feb 2019 16:59:07 +0000
changeset 516090 e61f6b679a94e0996b7ea6ccfcaf7e0eee98764c
parent 516089 71f45dc5eca03e82ed4cb309c827971d37807994
child 516091 bc255d1f31ab69707e4beadae3c4f495eb2ca94e
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspetru, lizzard
bugs1527648, 1519418
milestone66.0
Bug 1527648 - Uid deeplink nullpointer check. r=petru, a=lizzard Patch from bug 1519418 introduced a regression by removing line separators from the uid parameter contained within deeplinks. However, not all deeplinks are mandatory to contain the uid parameter. Added a null check before replacing the line separators. Differential Revision: https://phabricator.services.mozilla.com/D20367
mobile/android/base/java/org/mozilla/gecko/LauncherActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/LauncherActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/LauncherActivity.java
@@ -190,17 +190,20 @@ public class LauncherActivity extends Ac
         return schemeMatched && actionMatched;
     }
 
     private void dispatchDeepLink(SafeIntent intent) {
         if (intent == null || intent.getData() == null || intent.getData().getHost() == null) {
             return;
         }
         final String deepLink = intent.getData().getHost();
-        final String uid = intent.getData().getQueryParameter("uid").replaceAll("\\n", "");
+        String uid = intent.getData().getQueryParameter("uid");
+        if (uid != null) {
+            uid = uid.replaceAll("\\n", "");
+        }
         final String localUid = MmaDelegate.getDeviceId(LauncherActivity.this);
         final boolean isMmaDeepLink = uid != null && localUid != null && uid.equals(localUid);
 
         if (!validateMmaDeepLink(deepLink, isMmaDeepLink)) {
             return;
         }
 
         switch (deepLink) {