From: Damyan Ivanov Date: Fri, 3 May 2019 16:08:57 +0000 (+0300) Subject: ignore request to update the last update date when there is no current profile X-Git-Tag: v0.10.0~37 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=commitdiff_plain;h=a26e0d3df1c20585c47a1513b1b11af3e4b79fcf ignore request to update the last update date when there is no current profile --- 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) {