]> git.ktnx.net Git - mobile-ledger.git/commitdiff
ignore request to update the last update date when there is no current profile
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 3 May 2019 16:08:57 +0000 (19:08 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 3 May 2019 16:11:45 +0000 (19:11 +0300)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index 484bcb018f3faef03af558a8bf8ac75703e5d679..bbc8fa79428b42c9d29d2fbe3c1255d57eacf09a 100644 (file)
@@ -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) {