]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed Grid crash when rendering first time and no header available (#17412)
authorPekka Hyvönen <pekka@vaadin.com>
Mon, 11 May 2015 12:07:51 +0000 (15:07 +0300)
committerPekka Hyvönen <pekka@vaadin.com>
Mon, 11 May 2015 12:07:51 +0000 (15:07 +0300)
Need to catch IndexOutOfBoundsException thrown by Escalator.

Change-Id: I7593d6c4eb3f948d494688800dcf42c2ae963b07

client/src/com/vaadin/client/widgets/Grid.java

index 4951997995c6d435f65b5826fe4af8fbcd4f42f8..773c7ac6a012f01dba44adc75c577d144eb1a5ab 100644 (file)
@@ -3179,6 +3179,13 @@ public class Grid<T> extends ResizeComposite implements
                                 "Got null header first row or first row cell when calculating sidebar button height");
                 openCloseButton.setHeight(grid.escalator.getHeader()
                         .getDefaultRowHeight() + "px");
+            } catch (IndexOutOfBoundsException ioobe) {
+                // happens when escalator doesn't have any headers rendered yet.
+                getLogger()
+                        .warning(
+                                "No header cell available when calculating sidebar button height");
+                openCloseButton.setHeight(grid.escalator.getHeader()
+                        .getDefaultRowHeight() + "px");
             }
         }