mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 19:34:15 +01:00
Fix no public key
This commit is contained in:
@@ -2027,7 +2027,7 @@ public class FragmentCompose extends FragmentBase {
|
||||
String email = ((InternetAddress) address).getAddress();
|
||||
List<EntityCertificate> e = db.certificate().getCertificateByEmail(email);
|
||||
if (e == null || e.size() < 1)
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_certificate_missing, email));
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_certificate_missing, email), new IllegalStateException());
|
||||
X509Certificate cert = (X509Certificate) CertificateFactory.getInstance("X.509")
|
||||
.generateCertificate(new ByteArrayInputStream(e.get(0).getEncoded()));
|
||||
certs.add(cert);
|
||||
@@ -2096,7 +2096,17 @@ public class FragmentCompose extends FragmentBase {
|
||||
protected void onException(Bundle args, Throwable ex) {
|
||||
if (ex instanceof IllegalArgumentException) {
|
||||
Log.i(ex);
|
||||
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();
|
||||
Snackbar snackbar = Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG);
|
||||
if (ex.getCause() instanceof IllegalStateException)
|
||||
snackbar.setAction(R.string.title_fix, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(
|
||||
new Intent(getContext(), ActivitySetup.class)
|
||||
.putExtra("tab", "privacy"));
|
||||
}
|
||||
});
|
||||
snackbar.show();
|
||||
} else
|
||||
Helper.unexpectedError(getParentFragmentManager(), ex);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ public class FragmentOptions extends FragmentBase {
|
||||
pager.setCurrentItem(3);
|
||||
else if ("display".equals(tab))
|
||||
pager.setCurrentItem(4);
|
||||
else if ("privacy".equals(tab))
|
||||
pager.setCurrentItem(6);
|
||||
getActivity().getIntent().removeExtra("tab");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user