From 1a5058eb3f2a3ef241ba50f6a8a2d9508467408e Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 20 Oct 2019 14:00:30 +0200 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/ActivitySetup.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 95928a8875..40f0888f66 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -913,12 +913,13 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac Log.w("Inferring type of value=" + value); if (value instanceof Boolean) editor.putBoolean(key, (Boolean) value); - else if (value instanceof Integer) + else if (value instanceof Integer) { + Integer i = (Integer) value; if (key.endsWith(".account")) - editor.putLong(key, (Long) value); + editor.putLong(key, Long.valueOf(i)); else - editor.putInt(key, (Integer) value); - else if (value instanceof Long) + editor.putInt(key, i); + } else if (value instanceof Long) editor.putLong(key, (Long) value); else if (value instanceof String) editor.putString(key, (String) value);