diff options
-rw-r--r-- | src/com/vaadin/ui/AbstractComponent.java | 7 |
1 files changed, 6 insertions, 1 deletions
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(); + } } /** |