diff --git a/library/src/main/java/com/github/channguyen/rsv/RangeSliderView.java b/library/src/main/java/com/github/channguyen/rsv/RangeSliderView.java index 4b8da6c..08e4f9f 100644 --- a/library/src/main/java/com/github/channguyen/rsv/RangeSliderView.java +++ b/library/src/main/java/com/github/channguyen/rsv/RangeSliderView.java @@ -256,7 +256,7 @@ private void preComputeDrawingPosition() { } public void setInitialIndex(int index) { - if (index < 0 || index > rangeCount) { + if (index < 0 || index >= rangeCount) { throw new IllegalArgumentException("Attempted to set index=" + index + " out of range [0," + rangeCount + "]"); } currentIndex = index;