Bug 1474973: Fix NULL_DEREFERENCE errors. r=nalexander
authorRobert Bartlensky <rbartlensky@mozilla.com>
Thu, 12 Jul 2018 10:53:44 +0100
changeset 819857 b3e82720e36c04304b3eee19276b2b802fb51053
parent 819856 dd8b72cfda82d0924dca8a98275ebf82bf80dbdf
child 819858 99ac85a273af610206c5077fed6a5841d9678291
push id116678
push userbmo:nchevobbe@mozilla.com
push dateWed, 18 Jul 2018 18:05:12 +0000
reviewersnalexander
bugs1474973
milestone63.0a1
Bug 1474973: Fix NULL_DEREFERENCE errors. r=nalexander MozReview-Commit-ID: 8petRuuRGv
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
@@ -1706,17 +1706,17 @@ public class GeckoAppShell
     private static boolean unlockProfile() {
         // Try to kill any zombie Fennec's that might be running
         GeckoAppShell.killAnyZombies();
 
         // Then force unlock this profile
         final GeckoProfile profile = GeckoThread.getActiveProfile();
         if (profile != null) {
             File lock = profile.getFile(".parentlock");
-            return lock.exists() && lock.delete();
+            return lock != null && lock.exists() && lock.delete();
         }
         return false;
     }
 
     @WrapForJNI(calledFrom = "gecko")
     private static String getProxyForURI(String spec, String scheme, String host, int port) {
         final ProxySelector ps = new ProxySelector();