Need to be more defensive about cache clearing with slow SD cards
This commit is contained in:
parent
ce9fa45034
commit
2ad2b86e88
@ -50,10 +50,10 @@ public class FDroidApp extends Application {
|
||||
if (!prefs.getBoolean("cacheDownloaded", false)) {
|
||||
|
||||
File local_path = DB.getDataPath(this);
|
||||
|
||||
File[] files = local_path.listFiles();
|
||||
// files can be null if the SD card is not ready - we'll just
|
||||
// Things can be null if the SD card is not ready - we'll just
|
||||
// ignore that and do it next time.
|
||||
if(local_path != null) {
|
||||
File[] files = local_path.listFiles();
|
||||
if(files != null) {
|
||||
for(File f : files) {
|
||||
if(f.getName().endsWith(".apk")) {
|
||||
@ -62,6 +62,7 @@ public class FDroidApp extends Application {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apps = null;
|
||||
invalidApps = new ArrayList<String>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user