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)) {
|
if (!prefs.getBoolean("cacheDownloaded", false)) {
|
||||||
|
|
||||||
File local_path = DB.getDataPath(this);
|
File local_path = DB.getDataPath(this);
|
||||||
|
// Things can be null if the SD card is not ready - we'll just
|
||||||
File[] files = local_path.listFiles();
|
|
||||||
// files can be null if the SD card is not ready - we'll just
|
|
||||||
// ignore that and do it next time.
|
// ignore that and do it next time.
|
||||||
|
if(local_path != null) {
|
||||||
|
File[] files = local_path.listFiles();
|
||||||
if(files != null) {
|
if(files != null) {
|
||||||
for(File f : files) {
|
for(File f : files) {
|
||||||
if(f.getName().endsWith(".apk")) {
|
if(f.getName().endsWith(".apk")) {
|
||||||
@ -62,6 +62,7 @@ public class FDroidApp extends Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
apps = null;
|
apps = null;
|
||||||
invalidApps = new ArrayList<String>();
|
invalidApps = new ArrayList<String>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user