Avoid a couple possible NullPointerExceptions

This commit is contained in:
Daniel Martí 2013-12-12 00:19:53 +01:00
parent 10fa5108da
commit 00a0f4399f

View File

@ -378,10 +378,12 @@ public class DB {
StringBuilder logMsg = new StringBuilder(); StringBuilder logMsg = new StringBuilder();
logMsg.append("Available device features:"); logMsg.append("Available device features:");
features = new HashSet<String>(); features = new HashSet<String>();
for (FeatureInfo fi : pm.getSystemAvailableFeatures()) { if (pm != null) {
features.add(fi.name); for (FeatureInfo fi : pm.getSystemAvailableFeatures()) {
logMsg.append('\n'); features.add(fi.name);
logMsg.append(fi.name); logMsg.append('\n');
logMsg.append(fi.name);
}
} }
cpuAbis = new ArrayList<String>(); cpuAbis = new ArrayList<String>();
@ -866,8 +868,10 @@ public class DB {
if (app.installedVersion == null) if (app.installedVersion == null)
app.installedVersion = "null"; app.installedVersion = "null";
app.installedVerCode = sysapk.versionCode; app.installedVerCode = sysapk.versionCode;
app.userInstalled = ((sysapk.applicationInfo.flags if (sysapk.applicationInfo != null) {
& ApplicationInfo.FLAG_SYSTEM) != 1); app.userInstalled = ((sysapk.applicationInfo.flags
& ApplicationInfo.FLAG_SYSTEM) != 1);
}
} else { } else {
app.installedVersion = null; app.installedVersion = null;
app.installedVerCode = 0; app.installedVerCode = 0;