From e248adc283ccc79ef89f3f752cd0f516e09f8a2c Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 13 Mar 2012 11:10:51 +0200 Subject: [PATCH] NPE fix for getIcon() --- src/com/vaadin/ui/AbstractComponent.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java index 5d0574b08e..5791ff21cd 100644 --- a/src/com/vaadin/ui/AbstractComponent.java +++ b/src/com/vaadin/ui/AbstractComponent.java @@ -334,7 +334,12 @@ public abstract class AbstractComponent implements Component, MethodEventSource * use the default documentation from implemented interface. */ public Resource getIcon() { - return ((ResourceReference) getState().getIcon()).getResource(); + ResourceReference ref = ((ResourceReference) getState().getIcon()); + if (ref == null) { + return null; + } else { + return ref.getResource(); + } } /** -- 2.39.5