mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Prevent crash
This commit is contained in:
parent
0a80d21534
commit
9f3fd02e34
3 changed files with 8 additions and 8 deletions
|
@ -162,7 +162,7 @@ public class EntityAccount implements Serializable {
|
||||||
if (json.has("realm"))
|
if (json.has("realm"))
|
||||||
account.realm = json.getString("realm");
|
account.realm = json.getString("realm");
|
||||||
|
|
||||||
if (json.has("name"))
|
if (json.has("name") && !json.isNull("name"))
|
||||||
account.name = json.getString("name");
|
account.name = json.getString("name");
|
||||||
if (json.has("color"))
|
if (json.has("color"))
|
||||||
account.color = json.getInt("color");
|
account.color = json.getInt("color");
|
||||||
|
@ -180,7 +180,7 @@ public class EntityAccount implements Serializable {
|
||||||
account.swipe_right = json.getLong("swipe_right");
|
account.swipe_right = json.getLong("swipe_right");
|
||||||
|
|
||||||
account.poll_interval = json.getInt("poll_interval");
|
account.poll_interval = json.getInt("poll_interval");
|
||||||
if (json.has("prefix"))
|
if (json.has("prefix") && !json.isNull("prefix"))
|
||||||
account.prefix = json.getString("prefix");
|
account.prefix = json.getString("prefix");
|
||||||
|
|
||||||
return account;
|
return account;
|
||||||
|
|
|
@ -322,7 +322,7 @@ public class EntityFolder implements Serializable {
|
||||||
else
|
else
|
||||||
folder.keep_days = folder.sync_days;
|
folder.keep_days = folder.sync_days;
|
||||||
|
|
||||||
if (json.has("display"))
|
if (json.has("display") && !json.isNull("display"))
|
||||||
folder.display = json.getString("display");
|
folder.display = json.getString("display");
|
||||||
|
|
||||||
if (json.has("hide"))
|
if (json.has("hide"))
|
||||||
|
|
|
@ -141,11 +141,11 @@ public class EntityIdentity {
|
||||||
// id
|
// id
|
||||||
identity.name = json.getString("name");
|
identity.name = json.getString("name");
|
||||||
identity.email = json.getString("email");
|
identity.email = json.getString("email");
|
||||||
if (json.has("display"))
|
if (json.has("display") && !json.isNull("display"))
|
||||||
identity.display = json.getString("display");
|
identity.display = json.getString("display");
|
||||||
if (json.has("color"))
|
if (json.has("color"))
|
||||||
identity.color = json.getInt("color");
|
identity.color = json.getInt("color");
|
||||||
if (json.has("signature"))
|
if (json.has("signature") && !json.isNull("signature"))
|
||||||
identity.signature = json.getString("signature");
|
identity.signature = json.getString("signature");
|
||||||
|
|
||||||
identity.auth_type = json.getInt("auth_type");
|
identity.auth_type = json.getInt("auth_type");
|
||||||
|
@ -155,7 +155,7 @@ public class EntityIdentity {
|
||||||
identity.port = json.getInt("port");
|
identity.port = json.getInt("port");
|
||||||
identity.user = json.getString("user");
|
identity.user = json.getString("user");
|
||||||
identity.password = json.getString("password");
|
identity.password = json.getString("password");
|
||||||
if (json.has("realm"))
|
if (json.has("realm") && !json.isNull("realm"))
|
||||||
identity.realm = json.getString("realm");
|
identity.realm = json.getString("realm");
|
||||||
if (json.has("use_ip"))
|
if (json.has("use_ip"))
|
||||||
identity.use_ip = json.getBoolean("use_ip");
|
identity.use_ip = json.getBoolean("use_ip");
|
||||||
|
@ -163,9 +163,9 @@ public class EntityIdentity {
|
||||||
identity.synchronize = json.getBoolean("synchronize");
|
identity.synchronize = json.getBoolean("synchronize");
|
||||||
identity.primary = json.getBoolean("primary");
|
identity.primary = json.getBoolean("primary");
|
||||||
|
|
||||||
if (json.has("replyto"))
|
if (json.has("replyto") && !json.isNull("replyto"))
|
||||||
identity.replyto = json.getString("replyto");
|
identity.replyto = json.getString("replyto");
|
||||||
if (json.has("bcc"))
|
if (json.has("bcc") && !json.isNull("bcc"))
|
||||||
identity.bcc = json.getString("bcc");
|
identity.bcc = json.getString("bcc");
|
||||||
|
|
||||||
if (json.has("plain_only"))
|
if (json.has("plain_only"))
|
||||||
|
|
Loading…
Reference in a new issue