1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Prevent crash

This commit is contained in:
M66B 2019-03-14 17:52:15 +00:00
parent 0a80d21534
commit 9f3fd02e34
3 changed files with 8 additions and 8 deletions

View file

@ -162,7 +162,7 @@ public class EntityAccount implements Serializable {
if (json.has("realm"))
account.realm = json.getString("realm");
if (json.has("name"))
if (json.has("name") && !json.isNull("name"))
account.name = json.getString("name");
if (json.has("color"))
account.color = json.getInt("color");
@ -180,7 +180,7 @@ public class EntityAccount implements Serializable {
account.swipe_right = json.getLong("swipe_right");
account.poll_interval = json.getInt("poll_interval");
if (json.has("prefix"))
if (json.has("prefix") && !json.isNull("prefix"))
account.prefix = json.getString("prefix");
return account;

View file

@ -322,7 +322,7 @@ public class EntityFolder implements Serializable {
else
folder.keep_days = folder.sync_days;
if (json.has("display"))
if (json.has("display") && !json.isNull("display"))
folder.display = json.getString("display");
if (json.has("hide"))

View file

@ -141,11 +141,11 @@ public class EntityIdentity {
// id
identity.name = json.getString("name");
identity.email = json.getString("email");
if (json.has("display"))
if (json.has("display") && !json.isNull("display"))
identity.display = json.getString("display");
if (json.has("color"))
identity.color = json.getInt("color");
if (json.has("signature"))
if (json.has("signature") && !json.isNull("signature"))
identity.signature = json.getString("signature");
identity.auth_type = json.getInt("auth_type");
@ -155,7 +155,7 @@ public class EntityIdentity {
identity.port = json.getInt("port");
identity.user = json.getString("user");
identity.password = json.getString("password");
if (json.has("realm"))
if (json.has("realm") && !json.isNull("realm"))
identity.realm = json.getString("realm");
if (json.has("use_ip"))
identity.use_ip = json.getBoolean("use_ip");
@ -163,9 +163,9 @@ public class EntityIdentity {
identity.synchronize = json.getBoolean("synchronize");
identity.primary = json.getBoolean("primary");
if (json.has("replyto"))
if (json.has("replyto") && !json.isNull("replyto"))
identity.replyto = json.getString("replyto");
if (json.has("bcc"))
if (json.has("bcc") && !json.isNull("bcc"))
identity.bcc = json.getString("bcc");
if (json.has("plain_only"))