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


Ignore:
Timestamp:
2018-05-13T14:28:01+02:00 (16 months ago)
Author:
wiktorn
Message:

Fix NPE when no layer selected

See: #16249

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanel.java

    r13752 r13755  
    7070                layerTable = new WMTSLayerSelection(layers);
    7171                layerTable.getTable().getSelectionModel().addListSelectionListener(lsl -> {
    72                     name.setText(capabilities.getBaseUrl() + ": " + layerTable.getSelectedLayer().getUserTitle());
     72                    if (layerTable.getSelectedLayer() != null) {
     73                        name.setText(capabilities.getBaseUrl() + ": " + layerTable.getSelectedLayer().getUserTitle());
     74                    } else {
     75                        name.setText(capabilities.getBaseUrl() + ": ");
     76                    }
    7377                });
    7478                layerPanel.removeAll();
Note: See TracChangeset for help on using the changeset viewer.