From: Artur Signell Date: Tue, 13 Mar 2012 09:10:51 +0000 (+0200) Subject: NPE fix for getIcon() X-Git-Tag: 7.0.0.alpha2~343 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e248adc283ccc79ef89f3f752cd0f516e09f8a2c;p=vaadin-framework.git NPE fix for getIcon() --- 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(); + } } /**