Bug 1510946 - Guard against a null external files dir. r=snorp
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 29 Nov 2018 14:24:24 +0000
changeset 505175 a865260c7f9741eb5c875c32ea16f59ac19db9cb
parent 505149 85dab0b936897a3ce5d7f96bdd2a1c92bc0a8500
child 505176 e79c6da7b0fed02d2654133eb6cd05ce069490b9
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)
reviewerssnorp
bugs1510946
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 1510946 - Guard against a null external files dir. r=snorp Differential Revision: https://phabricator.services.mozilla.com/D13401
mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java
@@ -149,17 +149,19 @@ public final class GeckoLoader {
         f = Environment.getDownloadCacheDirectory();
         putenv("EXTERNAL_STORAGE=" + f.getPath());
 
         // setup the app-specific cache path
         f = context.getCacheDir();
         putenv("CACHE_DIRECTORY=" + f.getPath());
 
         f = context.getExternalFilesDir(null);
-        putenv("PUBLIC_STORAGE=" + f.getPath());
+        if (f != null) {
+            putenv("PUBLIC_STORAGE=" + f.getPath());
+        }
 
         if (Build.VERSION.SDK_INT >= 17) {
             android.os.UserManager um = (android.os.UserManager)context.getSystemService(Context.USER_SERVICE);
             if (um != null) {
                 putenv("MOZ_ANDROID_USER_SERIAL_NUMBER=" + um.getSerialNumberForUser(android.os.Process.myUserHandle()));
             } else {
                 Log.d(LOGTAG, "Unable to obtain user manager service on a device with SDK version " + Build.VERSION.SDK_INT);
             }