From 0f70d06141a33ad1052edaf8e96db2fa80cf6e57 Mon Sep 17 00:00:00 2001 From: DrDisagree Date: Sun, 1 Dec 2024 00:06:08 +0600 Subject: [PATCH] Fix slider preference crash when no values found Signed-off-by: DrDisagree --- .../drdisagree/iconify/ui/preferences/SliderPreference.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/drdisagree/iconify/ui/preferences/SliderPreference.java b/app/src/main/java/com/drdisagree/iconify/ui/preferences/SliderPreference.java index cebbff3e6..cd35680a3 100644 --- a/app/src/main/java/com/drdisagree/iconify/ui/preferences/SliderPreference.java +++ b/app/src/main/java/com/drdisagree/iconify/ui/preferences/SliderPreference.java @@ -320,7 +320,10 @@ private void handleResetButton() { if (showResetButton) { mResetButton.setVisibility(View.VISIBLE); - mResetButton.setEnabled(isEnabled() && !Objects.equals(slider.getValues().get(0), defaultValue.get(0))); + + if (!slider.getValues().isEmpty()) { + mResetButton.setEnabled(isEnabled() && !Objects.equals(slider.getValues().get(0), defaultValue.get(0))); + } } else { mResetButton.setVisibility(View.GONE); }