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 02eb809..641d296 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();
     }
 }