From: Damyan Ivanov Date: Fri, 3 May 2019 16:09:10 +0000 (+0300) Subject: setCurrentProfile: no crash if given a null argument X-Git-Tag: v0.10.0~36 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=07550b72fdaa5879b41952c3ef7c4a401b8ade64;p=mobile-ledger.git setCurrentProfile: no crash if given a null argument --- diff --git a/app/src/main/java/net/ktnx/mobileledger/model/Data.java b/app/src/main/java/net/ktnx/mobileledger/model/Data.java index 64153847..243cb361 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/Data.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/Data.java @@ -71,7 +71,7 @@ public final class Data { backgroundTasksRunning.postValue(cnt > 0); } public static void setCurrentProfile(MobileLedgerProfile newProfile) { - MLDB.setOption(MLDB.OPT_PROFILE_UUID, newProfile.getUuid()); + MLDB.setOption(MLDB.OPT_PROFILE_UUID, (newProfile == null) ? null : newProfile.getUuid()); stopTransactionsRetrieval(); profile.postValue(newProfile); }