public static void setCurrentProfile(MobileLedgerProfile newProfile) {
MLDB.setOption(MLDB.OPT_PROFILE_UUID, (newProfile == null) ? null : newProfile.getUuid());
stopTransactionsRetrieval();
- profile.postValue(newProfile);
+ profile.setValue(newProfile);
}
public static int getProfileIndex(MobileLedgerProfile profile) {
try (LockHolder ignored = profilesLocker.lockForReading()) {
return;
}
MobileLedgerProfile pr = profile.getValue();
- if (pr == null)
- throw new IllegalStateException("No current profile");
+ if (pr == null) {
+ Logger.debug("ui", "Ignoring refresh -- no current profile");
+ return;
+ }
retrieveTransactionsTask =
new RetrieveTransactionsTask(new WeakReference<>(activity), profile.getValue());