From 07550b72fdaa5879b41952c3ef7c4a401b8ade64 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 3 May 2019 19:09:10 +0300 Subject: [PATCH] setCurrentProfile: no crash if given a null argument --- app/src/main/java/net/ktnx/mobileledger/model/Data.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.39.5