Ignore:
Timestamp:
2017-07-14T11:24:46+02:00 (7 years ago)
Author:
giackserva
Message:

[pt_assistant] #josm14977 - handle case with way conflict on the first way

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/SortPTStopsAction.java

    r33440 r33442  
    185185        }
    186186
    187         boolean reverse = prev.firstNode().equals(way.lastNode())
    188                 || prev.lastNode().equals(way.lastNode());
     187        boolean reverse = prev != null &&
     188                (prev.firstNode().equals(way.lastNode())
     189                        || prev.lastNode().equals(way.lastNode()));
    189190
    190191        if (reverse)
    191192            Collections.reverse(nodes);
     193
     194        List<PTStop> ret = getSortedStops(nodes, closeNodes);
     195        ret.addAll(noLocationStops);
     196        return ret;
     197    }
     198
     199    private List<PTStop> getSortedStops(List<Node> nodes,
     200            Map<Node, List<PTStop>> closeNodes) {
    192201
    193202        List<PTStop> ret = new ArrayList<>();
     
    208217        }
    209218
    210         ret.addAll(noLocationStops);
    211219        return ret;
    212220    }
Note: See TracChangeset for help on using the changeset viewer.