fix NPE for data signed with an unknown key

This commit is contained in:
Vincent Breitmoser
2018-07-15 12:08:12 +02:00
parent 891c0e10c4
commit fbbc77335b

View File

@@ -263,6 +263,9 @@ public abstract class DecryptFragment extends Fragment {
unifiedKeyInfoLiveData = new GenericLiveData<>(requireContext(), () -> {
KeyRepository keyRepository = KeyRepository.create(requireContext());
Long masterKeyId = keyRepository.getMasterKeyIdBySubkeyId(mSignatureResult.getKeyId());
if (masterKeyId == null) {
return null;
}
return keyRepository.getUnifiedKeyInfo(masterKeyId);
});
unifiedKeyInfoLiveData.observe(this, this::onLoadSignerKeyData);