Bug 1269682 - Always detect guest mode first; r=margaret
authorJim Chen <nchen@mozilla.com>
Mon, 09 May 2016 22:31:18 -0400
changeset 365169 fe2780a12fd33798a2bdce62497bc175f054418e
parent 365168 710f4c21891e81e0363eca32b412980951d38116
child 365170 930c3c4a7730ff40efb65423a7380869c18dee7c
child 365253 bc8055a37b4a8e2f17a88bb50780f252a2ed8955
push id17650
push usermartin.thomson@gmail.com
push dateTue, 10 May 2016 05:06:10 +0000
reviewersmargaret
bugs1269682
milestone49.0a1
Bug 1269682 - Always detect guest mode first; r=margaret Always check for guest mode even if we don't have arguments, because we can still be in guest mode even if we don't have arguments.
mobile/android/base/java/org/mozilla/gecko/GeckoProfile.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoProfile.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoProfile.java
@@ -109,24 +109,24 @@ public final class GeckoProfile {
         UNLOCKED,
         UNDEFINED
     };
 
     /**
      * Can return null.
      */
     public static GeckoProfile getFromArgs(final Context context, final String args) {
+        if (GuestSession.shouldUse(context, args)) {
+            return GeckoProfile.getOrCreateGuestProfile(context);
+        }
+
         if (args == null) {
             return null;
         }
 
-        if (GuestSession.shouldUse(context, args)) {
-            return GeckoProfile.getOrCreateGuestProfile(context);
-        }
-
         String profileName = null;
         String profilePath = null;
         if (args.contains("-P")) {
             final Pattern p = Pattern.compile("(?:-P\\s*)(\\w*)(\\s*)");
             final Matcher m = p.matcher(args);
             if (m.find()) {
                 profileName = m.group(1);
             }