Changeset 18222 in josm


Ignore:
Timestamp:
2021-09-13T01:17:23+02:00 (3 years ago)
Author:
Don-vip
Message:

see #21319 - fix NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r17865 r18222  
    453453        setProjection(id, prefs, false);
    454454
    455         if (PROP_COORDINATES.put(((ICoordinateFormat) coordinatesCombo.getSelectedItem()).getId())) {
    456             CoordinateFormatManager.setCoordinateFormat((ICoordinateFormat) coordinatesCombo.getSelectedItem());
     455        ICoordinateFormat selectedItem = (ICoordinateFormat) coordinatesCombo.getSelectedItem();
     456        if (selectedItem != null && PROP_COORDINATES.put(selectedItem.getId())) {
     457            CoordinateFormatManager.setCoordinateFormat(selectedItem);
    457458        }
    458459
Note: See TracChangeset for help on using the changeset viewer.