From a26e0d3df1c20585c47a1513b1b11af3e4b79fcf Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 3 May 2019 19:08:57 +0300 Subject: [PATCH] ignore request to update the last update date when there is no current profile --- .../java/net/ktnx/mobileledger/ui/activity/MainActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index 484bcb01..bbc8fa79 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -552,7 +552,9 @@ public class MainActivity extends ProfileThemedActivity { } } public void updateLastUpdateTextFromDB() { - long last_update = (profile != null) ? profile.getLongOption(MLDB.OPT_LAST_SCRAPE, 0L) : 0; + if (profile == null) return; + + long last_update = profile.getLongOption(MLDB.OPT_LAST_SCRAPE, 0L); debug("transactions", String.format(Locale.ENGLISH, "Last update = %d", last_update)); if (last_update == 0) { -- 2.39.2