diff options
author | Artur Signell <artur@vaadin.com> | 2012-03-13 11:10:51 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-03-14 16:00:35 +0200 |
commit | e248adc283ccc79ef89f3f752cd0f516e09f8a2c (patch) | |
tree | 102649d83d99025e9ab76983b5a431a8aa6f7660 /src/com | |
parent | ed8e3a6d5a904258898b7d46984d4d565a83811e (diff) | |
download | vaadin-framework-e248adc283ccc79ef89f3f752cd0f516e09f8a2c.tar.gz vaadin-framework-e248adc283ccc79ef89f3f752cd0f516e09f8a2c.zip |
NPE fix for getIcon()
Diffstat (limited to 'src/com')
-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(); + } } /** |