From: Damyan Ivanov Date: Mon, 11 Feb 2019 21:44:35 +0000 (+0200) Subject: fix crash when profile has no value yet X-Git-Tag: v0.7~79 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=commitdiff_plain;h=b4d5812942fdb2ca89c9f048e539c4c65a8994cf fix crash when profile has no value yet 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 --- 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 02eb8096..641d296c 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 @@ -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(); } }