summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/data
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-11-12 16:38:43 +0200
committerVaadin Code Review <review@vaadin.com>2012-11-28 11:47:12 +0000
commit7fecb899c85c038415633857865cc5f20a3ab20e (patch)
tree8f67aa0f779aeb4060674b77f6b372e381031bb4 /server/src/com/vaadin/data
parent42f402de0e2ecb9e2816156ed78225cb41258390 (diff)
downloadvaadin-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.java7
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;
+ }
}
/*