From 29758b64d65f95db61352198f3be0b4d1f3f288c Mon Sep 17 00:00:00 2001
From: M66B <M66B@users.noreply.github.com>
Date: Tue, 11 Feb 2020 16:24:53 +0100
Subject: [PATCH] Fixed identity import

---
 app/src/main/java/eu/faircode/email/EntityIdentity.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/src/main/java/eu/faircode/email/EntityIdentity.java b/app/src/main/java/eu/faircode/email/EntityIdentity.java
index 5e9d0c5ea0..9d384ad74c 100644
--- a/app/src/main/java/eu/faircode/email/EntityIdentity.java
+++ b/app/src/main/java/eu/faircode/email/EntityIdentity.java
@@ -222,7 +222,8 @@ public class EntityIdentity {
             identity.provider = json.getString("provider");
         identity.user = json.getString("user");
         identity.password = json.getString("password");
-        identity.certificate_alias = json.getString("certificate_alias");
+        if (json.has("certificate_alias"))
+            identity.certificate_alias = json.getString("certificate_alias");
         if (json.has("realm") && !json.isNull("realm"))
             identity.realm = json.getString("realm");
         if (json.has("fingerprint"))