Changeset 12836 in josm for trunk/src/org


Ignore:
Timestamp:
2017-09-12T23:54:42+02:00 (7 years ago)
Author:
Don-vip
Message:

fix NPE (?) seen in unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r12726 r12836  
    227227        // update selection to reflect which way being modified
    228228        OsmDataLayer editLayer = getLayerManager().getEditLayer();
    229         if (editLayer != null && getCurrentBaseNode() != null && !editLayer.data.selectionEmpty()) {
     229        Node baseNode = getCurrentBaseNode();
     230        if (editLayer != null && baseNode != null && !editLayer.data.selectionEmpty()) {
    230231            DataSet currentDataSet = editLayer.data;
    231             Way continueFrom = getWayForNode(getCurrentBaseNode());
    232             if (alt && continueFrom != null && (!getCurrentBaseNode().isSelected() || continueFrom.isSelected())) {
    233                 addRemoveSelection(currentDataSet, getCurrentBaseNode(), continueFrom);
     232            Way continueFrom = getWayForNode(baseNode);
     233            if (alt && continueFrom != null && (!baseNode.isSelected() || continueFrom.isSelected())) {
     234                addRemoveSelection(currentDataSet, baseNode, continueFrom);
    234235                needsRepaint = true;
    235236            } else if (!alt && continueFrom != null && !continueFrom.isSelected()) {
Note: See TracChangeset for help on using the changeset viewer.