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


Ignore:
Timestamp:
2014-08-05T12:17:33+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #10348 - NPE when using F1 (Go to OSM wiki) on a relation without type key

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r7128 r7368  
    139139     */
    140140    private final JTable tagTable = new JTable(tagData);
    141    
     141
    142142    /**
    143143     * The membership table.
     
    257257            bothTables.add(presets, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 2, 5, 2));
    258258        }
    259        
     259
    260260        setupBlankSpaceMenu();
    261261        setupKeyboardShortcuts();
     
    279279
    280280        editHelper.loadTagsIfNeeded();
    281        
     281
    282282        Main.pref.addPreferenceChangeListener(this);
    283283    }
     
    583583            tagTable.getCellEditor().cancelCellEditing();
    584584        }
    585        
     585
    586586        // Ignore parameter as we do not want to operate always on real selection here, especially in draw mode
    587587        Collection<OsmPrimitive> newSel = Main.main.getInProgressSelection();
     
    10781078                } else if (membershipTable.getSelectedRowCount() == 1) {
    10791079                    row = membershipTable.getSelectedRow();
    1080                     String type = URLEncoder.encode(
    1081                             ((Relation)membershipData.getValueAt(row, 0)).get("type"), "UTF-8"
    1082                             );
     1080                    String type = ((Relation)membershipData.getValueAt(row, 0)).get("type");
     1081                    if (type != null) {
     1082                        type = URLEncoder.encode(type, "UTF-8");
     1083                    }
    10831084
    10841085                    if (type != null && !type.isEmpty()) {
     
    11111112                                    if (osize > -1) {
    11121113                                        conn.disconnect();
    1113    
     1114
    11141115                                        conn = Utils.openHttpConnection(new URI(u.toString()
    11151116                                                .replace("=", "%3D") /* do not URLencode whole string! */
Note: See TracChangeset for help on using the changeset viewer.