]> source.dussan.org Git - vaadin-framework.git/commitdiff
NPE fix for getIcon()
authorArtur Signell <artur@vaadin.com>
Tue, 13 Mar 2012 09:10:51 +0000 (11:10 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 14 Mar 2012 14:00:35 +0000 (16:00 +0200)
src/com/vaadin/ui/AbstractComponent.java

index 5d0574b08e3636a0e93c3d58268c56a216e8f9f4..5791ff21cd46be52a35c1b9a4b21f8e01dc55a60 100644 (file)
@@ -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();
+        }
     }
 
     /**