Don't assume all apps have a preferred signer, as media apps don't

Fixes #1156.
This commit is contained in:
Peter Serwylo 2017-09-05 12:56:05 +10:00 committed by Hans-Christoph Steiner
parent 620affa239
commit ac1dce24d2

View File

@ -1141,13 +1141,14 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
* the user to try and install versions with that signature (because thats all the OS will let
* them do).
*/
@NonNull
@Nullable
public String getMostAppropriateSignature() {
if (!TextUtils.isEmpty(installedSig)) {
return installedSig;
} else if (!TextUtils.isEmpty(preferredSigner)) {
return preferredSigner;
}
throw new IllegalStateException("Most Appropriate Signature not found!");
return null;
}
}