Skip to content

Commit

Permalink
Fix slider preference crash when no values found
Browse files Browse the repository at this point in the history
Signed-off-by: DrDisagree <[email protected]>
  • Loading branch information
Mahmud0808 committed Nov 30, 2024
1 parent 29f8553 commit 0f70d06
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0f70d06

Please sign in to comment.