Pebble: fix crash with emply pbw cache

This commit is contained in:
Andreas Shimokawa 2015-08-13 10:06:32 +02:00
parent 6ed54484a6
commit 749fbe5ecc
1 changed files with 7 additions and 5 deletions

View File

@ -68,12 +68,14 @@ public class AppManagerActivity extends Activity {
try {
File cachePath = new File(FileUtils.getExternalFilesDir().getPath() + "/pbw-cache");
File files[] = cachePath.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().endsWith(".pbw")) {
UUID uuid = UUID.fromString(file.getName().substring(0, file.getName().length() - 4));
cachedAppList.add(new GBDeviceApp(uuid, uuid.toString(), "N/A", "", GBDeviceApp.Type.UNKNOWN));
}
}
}
} catch (IOException e) {
e.printStackTrace();
}