Avoid a couple possible NullPointerExceptions
This commit is contained in:
parent
10fa5108da
commit
00a0f4399f
@ -378,11 +378,13 @@ 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>();
|
||||||
|
if (pm != null) {
|
||||||
for (FeatureInfo fi : pm.getSystemAvailableFeatures()) {
|
for (FeatureInfo fi : pm.getSystemAvailableFeatures()) {
|
||||||
features.add(fi.name);
|
features.add(fi.name);
|
||||||
logMsg.append('\n');
|
logMsg.append('\n');
|
||||||
logMsg.append(fi.name);
|
logMsg.append(fi.name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cpuAbis = new ArrayList<String>();
|
cpuAbis = new ArrayList<String>();
|
||||||
if (hasApi(8))
|
if (hasApi(8))
|
||||||
@ -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;
|
||||||
|
if (sysapk.applicationInfo != null) {
|
||||||
app.userInstalled = ((sysapk.applicationInfo.flags
|
app.userInstalled = ((sysapk.applicationInfo.flags
|
||||||
& ApplicationInfo.FLAG_SYSTEM) != 1);
|
& ApplicationInfo.FLAG_SYSTEM) != 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
app.installedVersion = null;
|
app.installedVersion = null;
|
||||||
app.installedVerCode = 0;
|
app.installedVerCode = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user