KeySetManagerService: prevent NPE

* If pubKeys is null, we cannot check the size of pubKeys

Test: none

Change-Id: I3b4074d8727b084fea98a0e0a5a0afbd96bea41d
This commit is contained in:
Thecrazyskull
2017-01-26 08:59:51 -06:00
parent 2c1e396382
commit 7664bceec3

View File

@@ -287,7 +287,7 @@ public class KeySetManagerService {
for (int i = 0; i < defMapSize; i++) {
String alias = definedMapping.keyAt(i);
ArraySet<PublicKey> pubKeys = definedMapping.valueAt(i);
if (alias != null && pubKeys != null || pubKeys.size() > 0) {
if (alias != null && pubKeys != null && pubKeys.size() > 0) {
KeySetHandle ks = addKeySetLPw(pubKeys);
newKeySetAliases.put(alias, ks.getId());
}