Ticket #3267: download-check-editlayer.patch

File download-check-editlayer.patch, 1.3 KB (added by plaicy, 17 years ago)
  • src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskList.java

     
    123123                    return;
    124124            }
    125125        }
    126         Set<Long> myPrimitiveIds = Main.map.mapView.getEditLayer().data.getCompletePrimitiveIds();
    127         Set<Long> downloadedIds = getDownloadedIds();
    128         myPrimitiveIds.removeAll(downloadedIds);
    129         myPrimitiveIds.remove(new Long(0)); // ignore new primitives
    130         if (! myPrimitiveIds.isEmpty()) {
    131             handlePotentiallyDeletedPrimitives(myPrimitiveIds);
     126        final OsmDataLayer editLayer = Main.map.mapView.getEditLayer();
     127        if (editLayer != null) {
     128            Set<Long> myPrimitiveIds = editLayer.data.getCompletePrimitiveIds();
     129            Set<Long> downloadedIds = getDownloadedIds();
     130            myPrimitiveIds.removeAll(downloadedIds);
     131            myPrimitiveIds.remove(new Long(0)); // ignore new primitives
     132            if (! myPrimitiveIds.isEmpty()) {
     133                handlePotentiallyDeletedPrimitives(myPrimitiveIds);
     134            }
    132135        }
    133136    }
    134137