Skip to content

Commit dd713b6

Browse files
committed
[Focus Rings] Fix BaseSlider crash in calculateTrackCenter() when labels list is empty
Resolves #5049 PiperOrigin-RevId: 895902192
1 parent 4626574 commit dd713b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/java/com/google/android/material/slider/BaseSlider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2719,7 +2719,7 @@ private void updateHaloHotspot() {
27192719

27202720
private int calculateTrackCenter() {
27212721
return widgetThickness / 2
2722-
+ (labelBehavior == LABEL_WITHIN_BOUNDS || shouldAlwaysShowLabel()
2722+
+ ((labelBehavior == LABEL_WITHIN_BOUNDS || shouldAlwaysShowLabel()) && !labels.isEmpty()
27232723
? labels.get(0).getIntrinsicHeight()
27242724
: 0);
27252725
}

0 commit comments

Comments
 (0)