]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed NPE in LayoutManager
authorJohn Ahlroos <john@vaadin.com>
Wed, 5 Sep 2012 07:55:20 +0000 (10:55 +0300)
committerJohn Ahlroos <john@vaadin.com>
Wed, 5 Sep 2012 07:55:20 +0000 (10:55 +0300)
client/src/com/vaadin/client/LayoutManager.java

index 7b6fe19a378b2ef77c5e81b8a249339eaca220ab..56622cbd1dc22ee7dc5e88b4addcc34732e1e52f 100644 (file)
@@ -282,15 +282,18 @@ public class LayoutManager {
                 for (Element element : listenersToFire) {
                     Collection<ElementResizeListener> listeners = elementResizeListeners
                             .get(element);
-                    ElementResizeListener[] array = listeners
-                            .toArray(new ElementResizeListener[listeners.size()]);
-                    ElementResizeEvent event = new ElementResizeEvent(this,
-                            element);
-                    for (ElementResizeListener listener : array) {
-                        try {
-                            listener.onElementResize(event);
-                        } catch (RuntimeException e) {
-                            VConsole.error(e);
+                    if (listeners != null) {
+                        ElementResizeListener[] array = listeners
+                                .toArray(new ElementResizeListener[listeners
+                                        .size()]);
+                        ElementResizeEvent event = new ElementResizeEvent(this,
+                                element);
+                        for (ElementResizeListener listener : array) {
+                            try {
+                                listener.onElementResize(event);
+                            } catch (RuntimeException e) {
+                                VConsole.error(e);
+                            }
                         }
                     }
                 }