diff options
author | Artur Signell <artur@vaadin.com> | 2012-11-12 16:38:43 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2012-11-28 11:47:12 +0000 |
commit | 7fecb899c85c038415633857865cc5f20a3ab20e (patch) | |
tree | 8f67aa0f779aeb4060674b77f6b372e381031bb4 /server/src/com/vaadin/data | |
parent | 42f402de0e2ecb9e2816156ed78225cb41258390 (diff) | |
download | vaadin-framework-7fecb899c85c038415633857865cc5f20a3ab20e.tar.gz vaadin-framework-7fecb899c85c038415633857865cc5f20a3ab20e.zip |
getPrevItemId should return null if id not found (#10124)
Change-Id: I9c0a07610e942bf8fac5832341a4fb31bfd6342a
Diffstat (limited to 'server/src/com/vaadin/data')
-rw-r--r-- | server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java index 305b7d5861..12cb892090 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java @@ -713,7 +713,12 @@ public class SQLContainer implements Container, Container.Filterable, @Override public Object prevItemId(Object itemId) { - return getIdByIndex(indexOfId(itemId) - 1); + int prevIndex = indexOfId(itemId) - 1; + try { + return getIdByIndex(prevIndex); + } catch (IndexOutOfBoundsException e) { + return null; + } } /* |