From e7e1b9e3033de1300ca1adfbd55f664f568f32f2 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Wed, 5 Sep 2012 10:55:20 +0300 Subject: [PATCH] Fixed NPE in LayoutManager --- .../src/com/vaadin/client/LayoutManager.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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); + } } } } -- 2.39.5