prevent NPE in test
This commit is contained in:
parent
53b9d97f5d
commit
68d9a5af70
1 changed files with 8 additions and 6 deletions
|
@ -111,6 +111,7 @@ public class SignatureVerifier extends PluginBase implements ConstraintsInterfac
|
||||||
synchronized ($lock) {
|
synchronized ($lock) {
|
||||||
if (revokedCerts == null) return false;
|
if (revokedCerts == null) return false;
|
||||||
Signature[] signatures = MainApp.instance().getPackageManager().getPackageInfo(MainApp.instance().getPackageName(), PackageManager.GET_SIGNATURES).signatures;
|
Signature[] signatures = MainApp.instance().getPackageManager().getPackageInfo(MainApp.instance().getPackageName(), PackageManager.GET_SIGNATURES).signatures;
|
||||||
|
if (signatures != null) {
|
||||||
for (Signature signature : signatures) {
|
for (Signature signature : signatures) {
|
||||||
MessageDigest digest = MessageDigest.getInstance("SHA256");
|
MessageDigest digest = MessageDigest.getInstance("SHA256");
|
||||||
byte[] fingerprint = digest.digest(signature.toByteArray());
|
byte[] fingerprint = digest.digest(signature.toByteArray());
|
||||||
|
@ -121,6 +122,7 @@ public class SignatureVerifier extends PluginBase implements ConstraintsInterfac
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
log.error("Error in SignatureVerifier", e);
|
log.error("Error in SignatureVerifier", e);
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
|
Loading…
Reference in a new issue