Pebble: fix crash with emply pbw cache
This commit is contained in:
parent
6ed54484a6
commit
749fbe5ecc
|
@ -68,10 +68,12 @@ public class AppManagerActivity extends Activity {
|
||||||
try {
|
try {
|
||||||
File cachePath = new File(FileUtils.getExternalFilesDir().getPath() + "/pbw-cache");
|
File cachePath = new File(FileUtils.getExternalFilesDir().getPath() + "/pbw-cache");
|
||||||
File files[] = cachePath.listFiles();
|
File files[] = cachePath.listFiles();
|
||||||
for (File file : files) {
|
if (files != null) {
|
||||||
if (file.getName().endsWith(".pbw")) {
|
for (File file : files) {
|
||||||
UUID uuid = UUID.fromString(file.getName().substring(0, file.getName().length() - 4));
|
if (file.getName().endsWith(".pbw")) {
|
||||||
cachedAppList.add(new GBDeviceApp(uuid, uuid.toString(), "N/A", "", GBDeviceApp.Type.UNKNOWN));
|
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) {
|
} catch (IOException e) {
|
||||||
|
@ -102,7 +104,7 @@ public class AppManagerActivity extends Activity {
|
||||||
});
|
});
|
||||||
|
|
||||||
registerForContextMenu(appListView);
|
registerForContextMenu(appListView);
|
||||||
|
|
||||||
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(GBApplication.getContext());
|
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(GBApplication.getContext());
|
||||||
|
|
||||||
if (sharedPrefs.getBoolean("pebble_force_untested", false)) {
|
if (sharedPrefs.getBoolean("pebble_force_untested", false)) {
|
||||||
|
|
Loading…
Reference in New Issue