diff options
author | Juuso Valli <juuso@vaadin.com> | 2014-05-26 17:22:18 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-05-27 07:29:30 +0000 |
commit | 930fd30a937ef69ba45e501bdee78773bad5523f (patch) | |
tree | c7e3e054d49715f27bf2c9c50b2d71d830cff2b4 /server | |
parent | 09c9de6e2a94553a324234157c7c9254011bef01 (diff) | |
download | vaadin-framework-930fd30a937ef69ba45e501bdee78773bad5523f.tar.gz vaadin-framework-930fd30a937ef69ba45e501bdee78773bad5523f.zip |
Fix Push update race condition (#13562)
Change-Id: I50094bc2d236f6dbb02a8b82d6cc9b5f7e4733a5
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/Table.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index b4d79f304c..a8265662ea 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -2957,12 +2957,19 @@ public class Table extends AbstractSelect implements Action.Container, if (value != null) { reqFirstRowToPaint = value.intValue(); } + value = (Integer) variables.get("reqrows"); if (value != null) { reqRowsToPaint = value.intValue(); + int size = size(); // sanity check - if (reqFirstRowToPaint + reqRowsToPaint > size()) { - reqRowsToPaint = size() - reqFirstRowToPaint; + + if (reqFirstRowToPaint >= size) { + reqFirstRowToPaint = size; + } + + if (reqFirstRowToPaint + reqRowsToPaint > size) { + reqRowsToPaint = size - reqFirstRowToPaint; } } } |