]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix crash when profile has no value yet
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 11 Feb 2019 21:44:35 +0000 (23:44 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 11 Feb 2019 21:44:35 +0000 (23:44 +0200)
seems to happen when the app is restarted after a crash
skipping the check seems fine, maybe because a following setting of
Data.profile triggers it again

app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java

index 02eb8096c7b2b0799515e45f95c2f72ed6292345..641d296c2d502c28ec81e0de4f71b215031d56a7 100644 (file)
@@ -395,6 +395,6 @@ public class MainActivity extends CrashReportingActivity {
     }
     public void fabShouldShow() {
         MobileLedgerProfile profile = Data.profile.get();
-        if (profile.isPostingPermitted()) fab.show();
+        if ((profile != null) && profile.isPostingPermitted()) fab.show();
     }
 }