--- a/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java	Tue May 05 17:39:15 2009 +0200
+++ b/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java	Tue May 05 20:50:05 2009 +0200
@@ -2,6 +2,8 @@
 
 import java.awt.Color;
 
+import javax.swing.ImageIcon;
+
 import org.openstreetmap.josm.tools.ColorHelper;
 import org.xml.sax.Attributes;
 import org.xml.sax.helpers.DefaultHandler;
@@ -169,12 +171,14 @@
             }
             else if (qName.equals("icon"))
             {
-                hadIcon = inIcon = true;
+                inIcon = true;
                 for (int count=0; count<atts.getLength(); count++)
                 {
-                    if (atts.getQName(count).equals("src"))
-                        rule.icon.icon = MapPaintStyles.getIcon(atts.getValue(count), styleName);
-                    else if (atts.getQName(count).equals("annotate"))
+                    if (atts.getQName(count).equals("src")) {
+                        ImageIcon icon = MapPaintStyles.getIcon(atts.getValue(count), styleName);
+                        hadIcon = (icon != null);
+                        rule.icon.icon = icon;
+                    } else if (atts.getQName(count).equals("annotate"))
                         rule.icon.annotate = Boolean.parseBoolean (atts.getValue(count));
                     else if(atts.getQName(count).equals("priority"))
                         rule.icon.priority = Integer.parseInt(atts.getValue(count));
