From: Damyan Ivanov Date: Thu, 24 Sep 2020 16:11:27 +0000 (+0000) Subject: emplye requireNonNull instead of a manual check X-Git-Tag: v0.16.0~53 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=c9ac05b5b8145ddf5b9b341e1074556966c59538;p=mobile-ledger.git emplye requireNonNull instead of a manual check --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java index 46a0ea6e..ec3ed661 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfileDetailFragment.java @@ -61,6 +61,7 @@ import org.jetbrains.annotations.NotNull; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; +import java.util.Objects; import java.util.UUID; import static net.ktnx.mobileledger.utils.Logger.debug; @@ -157,9 +158,8 @@ public class ProfileDetailFragment extends Fragment { private void triggerProfileChange() { int index = Data.getProfileIndex(mProfile); MobileLedgerProfile newProfile = new MobileLedgerProfile(mProfile); - final ArrayList profiles = Data.profiles.getValue(); - if (profiles == null) - throw new AssertionError(); + final ArrayList profiles = + Objects.requireNonNull(Data.profiles.getValue()); profiles.set(index, newProfile); ProfilesRecyclerViewAdapter viewAdapter = ProfilesRecyclerViewAdapter.getInstance();