Ticket #2535: missing-icon-npe.patch
| File missing-icon-npe.patch, 1.5 KB (added by , 17 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
a b 2 2 3 3 import java.awt.Color; 4 4 5 import javax.swing.ImageIcon; 6 5 7 import org.openstreetmap.josm.tools.ColorHelper; 6 8 import org.xml.sax.Attributes; 7 9 import org.xml.sax.helpers.DefaultHandler; … … 169 171 } 170 172 else if (qName.equals("icon")) 171 173 { 172 hadIcon =inIcon = true;174 inIcon = true; 173 175 for (int count=0; count<atts.getLength(); count++) 174 176 { 175 if (atts.getQName(count).equals("src")) 176 rule.icon.icon = MapPaintStyles.getIcon(atts.getValue(count), styleName); 177 else if (atts.getQName(count).equals("annotate")) 177 if (atts.getQName(count).equals("src")) { 178 ImageIcon icon = MapPaintStyles.getIcon(atts.getValue(count), styleName); 179 hadIcon = (icon != null); 180 rule.icon.icon = icon; 181 } else if (atts.getQName(count).equals("annotate")) 178 182 rule.icon.annotate = Boolean.parseBoolean (atts.getValue(count)); 179 183 else if(atts.getQName(count).equals("priority")) 180 184 rule.icon.priority = Integer.parseInt(atts.getValue(count));
