]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
ignore request to update the last update date when there is no current profile
[mobile-ledger.git] / 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) {