diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-01-18 13:52:14 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-02-13 12:18:26 +0000 |
commit | b5fb9c61ee7710558bdedda2ccf4c5e2f9481bff (patch) | |
tree | 420eae7c44218f3c6f8868a7aa71f12f0f543626 /client | |
parent | c317e6005b3bf17be404aa12c94593bd948fadef (diff) | |
download | vaadin-framework-b5fb9c61ee7710558bdedda2ccf4c5e2f9481bff.tar.gz vaadin-framework-b5fb9c61ee7710558bdedda2ccf4c5e2f9481bff.zip |
Fix NPE on column width detection in TreeTable and RowGenerator (#19437)
Change-Id: I7ed03d34124dda839bddc2507274a63b1e22f05f
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VScrollTable.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 74966d6b26..5e5ae8a259 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -5307,9 +5307,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, for (Widget row : renderedRows) { if (!(row instanceof VScrollTableGeneratedRow)) { TableRowElement tr = row.getElement().cast(); - Element wrapperdiv = tr.getCells().getItem(columnIndex) - .getFirstChildElement().cast(); - return wrapperdiv.getOffsetWidth(); + // Spanned rows might cause an NPE. + if (columnIndex < tr.getChildCount()) { + Element wrapperdiv = tr.getCells() + .getItem(columnIndex) + .getFirstChildElement().cast(); + return wrapperdiv.getOffsetWidth(); + } } } return 0; |