Merge "pm: Modify getPackage() to only return non-null packages" into pi-dev

This commit is contained in:
Jeffrey Vander Stoep
2018-03-08 08:27:44 +00:00
committed by Android (Google) Code Review

View File

@@ -105,7 +105,7 @@ public final class SharedUserSetting extends SettingBase {
} }
final ArrayList<PackageParser.Package> pkgList = new ArrayList<>(packages.size()); final ArrayList<PackageParser.Package> pkgList = new ArrayList<>(packages.size());
for (PackageSetting ps : packages) { for (PackageSetting ps : packages) {
if (ps == null) { if ((ps == null) || (ps.pkg == null)) {
continue; continue;
} }
pkgList.add(ps.pkg); pkgList.add(ps.pkg);