Changeset 13016 in josm


Ignore:
Timestamp:
2017-10-17T21:49:06+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #15443 - make sure dataset is always properly initialized in JoinAreasAction

File:
1 edited

Legend:

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

    r12828 r13016  
    109109         */
    110110        public Multipolygon(Way way) {
    111             outerWay = way;
     111            outerWay = Objects.requireNonNull(way, "way");
    112112            innerWays = new ArrayList<>();
    113113        }
     
    536536
    537537        try {
    538             // see #11026 - Because <ways> is a dynamic filtered (on ways) of a filtered (on selected objects) collection,
    539             // retrieve effective dataset before joining the ways (which affects the selection, thus, the <ways> collection)
    540             // Dataset retrieving allows to call this code without relying on Main.getCurrentDataSet(), thus, on a mapview instance
    541             ds = ways.iterator().next().getDataSet();
    542 
    543538            // Do the job of joining areas
    544539            JoinAreasResult result = joinAreas(areas);
     
    601596     */
    602597    public JoinAreasResult joinAreas(List<Multipolygon> areas) throws UserCancelException {
     598
     599        // see #11026 - Because <ways> is a dynamic filtered (on ways) of a filtered (on selected objects) collection,
     600        // retrieve effective dataset before joining the ways (which affects the selection, thus, the <ways> collection)
     601        // Dataset retrieving allows to call this code without relying on Main.getCurrentDataSet(), thus, on a mapview instance
     602        if (!areas.isEmpty()) {
     603            ds = areas.iterator().next().getOuterWay().getDataSet();
     604        }
    603605
    604606        boolean hasChanges = false;
Note: See TracChangeset for help on using the changeset viewer.