From 1976d032d1fb3ad9e95c6d2fdbbde43c1005b36d Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Mon, 28 Oct 2019 15:10:30 +0200 Subject: Fix the end limit of the allowed scrollTo rows. (#11771) (#11774) * Fix the end limit of the allowed scrollTo rows. (#11771) - Row index counts up from zero, data provider size counts up from one, as one would expect. If the two match we are already past the available range. --- server/src/main/java/com/vaadin/ui/Grid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 8d19d89a7e..1ac71ff984 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -4390,7 +4390,7 @@ public class Grid extends AbstractListing implements HasComponents, Objects.requireNonNull(destination, "ScrollDestination can not be null"); - if (row > getDataCommunicator().getDataProviderSize()) { + if (row >= getDataCommunicator().getDataProviderSize()) { throw new IllegalArgumentException("Row outside dataProvider size"); } -- cgit v1.2.3