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);
}
public static int getProfileIndex(MobileLedgerProfile profile) {
try (LockHolder ignored = profilesLocker.lockForReading()) {
List<MobileLedgerProfile> prList = profiles.getValue();
- assert prList != null;
+ if (prList == null) throw new AssertionError();
for (int i = 0; i < prList.size(); i++) {
MobileLedgerProfile p = prList.get(i);
if (p.equals(profile)) return i;
public static int getProfileIndex(String profileUUID) {
try (LockHolder ignored = profilesLocker.lockForReading()) {
List<MobileLedgerProfile> prList = profiles.getValue();
- assert prList != null;
+ if (prList == null) throw new AssertionError();
for (int i = 0; i < prList.size(); i++) {
MobileLedgerProfile p = prList.get(i);
if (p.getUuid().equals(profileUUID)) return i;