From c9ac05b5b8145ddf5b9b341e1074556966c59538 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 24 Sep 2020 16:11:27 +0000 Subject: [PATCH] emplye requireNonNull instead of a manual check --- .../mobileledger/ui/profiles/ProfileDetailFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(); -- 2.39.5