From: John Ahlroos Date: Wed, 5 Sep 2012 07:55:20 +0000 (+0300) Subject: Fixed NPE in LayoutManager X-Git-Tag: 7.0.0.beta1~193^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e7e1b9e3033de1300ca1adfbd55f664f568f32f2;p=vaadin-framework.git Fixed NPE in LayoutManager --- diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java index 7b6fe19a37..56622cbd1d 100644 --- a/client/src/com/vaadin/client/LayoutManager.java +++ b/client/src/com/vaadin/client/LayoutManager.java @@ -282,15 +282,18 @@ public class LayoutManager { for (Element element : listenersToFire) { Collection 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); + } } } }