Changeset 7989 in josm


Ignore:
Timestamp:
2015-01-27T21:33:31+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #11026 - NPE when joining areas (regression from r7987)

File:
1 edited

Legend:

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

    r7987 r7989  
    463463
    464464        try {
     465            // see #11026 - Because <ways> is a dynamic filtered (on ways) of a filtered (on selected objects) collection,
     466            // retrieve effective dataset before joining the ways (which affects the selection, thus, the <ways> collection)
     467            // Dataset retrieving allows to call this code without relying on Main.getCurrentDataSet(), thus, on a mapview instance
     468            DataSet ds = ways.iterator().next().getDataSet();
     469
     470            // Do the job of joining areas
    465471            JoinAreasResult result = joinAreas(areas);
    466472
     
    478484                    allWays.addAll(pol.innerWays);
    479485                }
    480                 DataSet ds = ways.iterator().next().getDataSet();
    481486                if (ds != null) {
    482487                    ds.setSelected(allWays);
Note: See TracChangeset for help on using the changeset viewer.