Changeset 5862 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2013-04-14T19:39:16+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #8380 - NPE in OsmPrimitivRenderer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/OsmPrimitivRenderer.java

    r4209 r5862  
    55
    66import javax.swing.DefaultListCellRenderer;
     7import javax.swing.ImageIcon;
    78import javax.swing.JLabel;
    89import javax.swing.JList;
     
    1213import javax.swing.table.TableCellRenderer;
    1314
     15import org.openstreetmap.josm.Main;
    1416import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1517import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
     
    6870        if (def != null && value != null && def instanceof JLabel) {
    6971            ((JLabel)def).setText(getComponentText(value));
    70             ((JLabel)def).setIcon(ImageProvider.get(value.getDisplayType()));
     72            ImageIcon icon = ImageProvider.get(value.getDisplayType());
     73            if (icon != null) {
     74                ((JLabel)def).setIcon(icon);
     75            } else {
     76                Main.warn("Null icon for "+value.getDisplayType());
     77            }
    7178            ((JLabel)def).setToolTipText(getComponentToolTipText(value));
    7279        }
Note: See TracChangeset for help on using the changeset viewer.