summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-04-27 18:59:51 +0300
committerLeif Åstrand <leif@vaadin.com>2014-04-28 16:50:08 +0000
commit43a2943572b594402230fb6ceaa1d565e8e4d636 (patch)
treedfcc2704ee28460d17402fc140c9149a607d1ad1 /client
parent0897607042fe8da4c20d02ae47d1ac0b326f243d (diff)
downloadvaadin-framework-43a2943572b594402230fb6ceaa1d565e8e4d636.tar.gz
vaadin-framework-43a2943572b594402230fb6ceaa1d565e8e4d636.zip
Avoid client side exception on DnD for empty table (#13655).
Change-Id: I71c18e87760ecbff34cfe215f56390fd75f3e55c
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VScrollTable.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java
index 6f575ca1c0..38f8ff8644 100644
--- a/client/src/com/vaadin/client/ui/VScrollTable.java
+++ b/client/src/com/vaadin/client/ui/VScrollTable.java
@@ -7101,7 +7101,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
dropDetails = new TableDDDetails();
Element elementOver = drag.getElementOver();
- VScrollTableRow row = Util.findWidget(elementOver, getRowClass());
+ Class<? extends Widget> clazz = getRowClass();
+ VScrollTableRow row = null;
+ if (clazz != null) {
+ row = Util.findWidget(elementOver, clazz);
+ }
if (row != null) {
dropDetails.overkey = row.rowKey;
Element tr = row.getElement();
@@ -7127,7 +7131,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
private Class<? extends Widget> getRowClass() {
// get the row type this way to make dd work in derived
// implementations
- return scrollBody.iterator().next().getClass();
+ Iterator<Widget> iterator = scrollBody.iterator();
+ if (iterator.hasNext()) {
+ return iterator.next().getClass();
+ } else {
+ return null;
+ }
}
@Override