String.format("[fragment] removing profile %s", mProfile.getUuid()));
mProfile.removeFromDB();
ArrayList<MobileLedgerProfile> oldList = Data.profiles.getValue();
- assert oldList != null;
+ if (oldList == null) throw new AssertionError();
ArrayList<MobileLedgerProfile> newList =
(ArrayList<MobileLedgerProfile>) oldList.clone();
newList.remove(mProfile);
if (mProfile.equals(Data.profile.getValue())) {
debug("profiles", "[fragment] setting current profile to 0");
Data.setCurrentProfile(newList.get(0));
- final FragmentActivity activity = getActivity();
- if (activity != null) activity.finish();
}
+
+ final FragmentActivity activity = getActivity();
+ if (activity != null) activity.finish();
});
builder.show();
return false;
int index = Data.getProfileIndex(mProfile);
MobileLedgerProfile newProfile = new MobileLedgerProfile(mProfile);
final ArrayList<MobileLedgerProfile> profiles = Data.profiles.getValue();
- assert profiles != null;
+ if (profiles == null) throw new AssertionError();
profiles.set(index, newProfile);
if (mProfile.equals(Data.profile.getValue())) Data.profile.setValue(newProfile);
}
updateProfileFromUI();
mProfile.storeInDB();
final ArrayList<MobileLedgerProfile> profiles = Data.profiles.getValue();
- assert profiles != null;
+ if (profiles == null) throw new AssertionError();
ArrayList<MobileLedgerProfile> newList =
(ArrayList<MobileLedgerProfile>) profiles.clone();
newList.add(mProfile);