Changeset 5541 in josm for trunk/src/org


Ignore:
Timestamp:
2012-10-28T12:43:17+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #8159 - NPE in imagery providers panel

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r5391 r5541  
    276276        if (imageryType != that.imageryType) return false;
    277277        if (url != null ? !url.equals(that.url) : that.url != null) return false;
     278        if (name != null ? !name.equals(that.name) : that.name != null) return false;
    278279
    279280        return true;
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r5493 r5541  
    219219                JLabel label = (JLabel) super.getTableCellRendererComponent(
    220220                        table, value, isSelected, hasFocus, row, column);
    221                 String t = value.toString();
    222221                label.setBackground(Main.pref.getUIColor("Table.background"));
    223222                if (isSelected) {
    224223                    label.setForeground(Main.pref.getUIColor("Table.foreground"));
    225224                }
    226                 for(ImageryInfo l : layers)
    227                 {
    228                     if(l.getExtendedUrl().equals(t)) {
    229                         label.setBackground(Main.pref.getColor(
    230                                 marktr("Imagery Background: Default"),
    231                                 new Color(200,255,200)));
    232                         break;
     225                if (value != null) { // Fix #8159
     226                    String t = value.toString();
     227                    for (ImageryInfo l : layers) {
     228                        if (l.getExtendedUrl().equals(t)) {
     229                            label.setBackground(Main.pref.getColor(
     230                                    marktr("Imagery Background: Default"),
     231                                    new Color(200,255,200)));
     232                            break;
     233                        }
    233234                    }
    234235                }
Note: See TracChangeset for help on using the changeset viewer.