Changeset 19587 in osm for applications


Ignore:
Timestamp:
2010-01-22T17:56:27+01:00 (15 years ago)
Author:
guggis
Message:

'Fixed NPE when icon is missing'

Location:
applications/editors/josm/plugins/tageditor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/tageditor/build.xml

    r19413 r19587  
    2828
    2929
    30         <property name="commit.message" value="Uses new constructor for Plugin" />
     30        <property name="commit.message" value="Fixed NPE when icon is missing" />
    3131        <property name="plugin.main.version" value="2830" />
    3232
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Item.java

    r17638 r19587  
    6969
    7070        public Icon getIcon() {
     71                // FIXME: should also load icons from the image paths configured in the
     72                // preferences for presets
     73                //
    7174                if (icon == null) {
    7275                        // load the icon from the JOSM resources, use Main classloader
     
    7578                        if (url == null) {
    7679                                logger.warning("failed to create URL for resource 'images/" + getIconName() + "'");
    77                                 icon = null;
     80                                return null;
    7881                        } else {
    7982                                icon =new ImageIcon(url);
    80                         }
     83                        }               
    8184                        Image i = icon.getImage().getScaledInstance(16, 16, Image.SCALE_DEFAULT);
    8285                        icon = new ImageIcon(i);
Note: See TracChangeset for help on using the changeset viewer.