bug 634530 - Fennec fails to startup on Droid Pro when the device is connected to PC via USB r=mbrubeck a=blocking-fennec
authorBrad Lassey <blassey@mozilla.com>
Wed, 16 Feb 2011 12:02:10 -0500
changeset 62674 972ccbb745326b451131da3fd48df3e0ddde45a4
parent 62673 bc02cd2cfd9830772d0a519769e161b94af5a6d5
child 62675 553f7b1974a3c511178cf399d054174b664e5421
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersmbrubeck, blocking-fennec
bugs634530
milestone2.0b12pre
bug 634530 - Fennec fails to startup on Droid Pro when the device is connected to PC via USB r=mbrubeck a=blocking-fennec
embedding/android/GeckoAppShell.java
--- a/embedding/android/GeckoAppShell.java
+++ b/embedding/android/GeckoAppShell.java
@@ -211,32 +211,32 @@ class GeckoAppShell
             File profileDir = new File(homeDir, "mozilla");
             File oldHome = new File("/data/data/" + 
                         GeckoApp.mAppContext.getPackageName() + "/mozilla");
             if (oldHome.exists())
                 moveDir(oldHome, profileDir);
             if (Build.VERSION.SDK_INT >= 8) {
                 File extHome =  geckoApp.getExternalFilesDir(null);
                 File extProf = new File (extHome, "mozilla");
-                if (extHome.exists())
+                if (extHome != null && extProf != null && extProf.exists())
                     moveDir(extProf, profileDir);
             }
         } else {
             File home = geckoApp.getExternalFilesDir(null);
             homeDir = home.getPath();
             // handle the application being moved to phone from sdcard
             File profileDir = new File(homeDir, "mozilla");
             File oldHome = new File("/data/data/" + 
                         GeckoApp.mAppContext.getPackageName() + "/mozilla");
             if (oldHome.exists())
                 moveDir(oldHome, profileDir);
 
             File intHome =  geckoApp.getFilesDir();
             File intProf = new File(intHome, "mozilla");
-            if (intHome.exists())
+            if (intHome != null && intProf != null && intProf.exists())
                 moveDir(intProf, profileDir);
         }
         GeckoAppShell.putenv("HOME=" + homeDir);
         GeckoAppShell.putenv("GRE_HOME=" + GeckoApp.sGREDir.getPath());
         Intent i = geckoApp.getIntent();
         String env = i.getStringExtra("env0");
         Log.i("GeckoApp", "env0: "+ env);
         for (int c = 1; env != null; c++) {