Changeset 29637 in osm for applications/editors/josm


Ignore:
Timestamp:
2013-06-07T00:51:31+02:00 (12 years ago)
Author:
donvip
Message:

[josm_osmarenderer] fix #josm6790 - osmarender plugin fails on null dataset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java

    r29635 r29637  
    2626import org.openstreetmap.josm.data.Bounds;
    2727import org.openstreetmap.josm.data.coor.LatLon;
     28import org.openstreetmap.josm.data.osm.DataSet;
    2829import org.openstreetmap.josm.data.osm.Node;
    2930import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    5354        @Override
    5455                public void actionPerformed(ActionEvent e) {
     56            DataSet ds = Main.main.getCurrentDataSet();
     57            if (ds == null) {
     58                return;
     59            }
     60           
    5561            // get all stuff visible on screen
    5662            LatLon bottomLeft = Main.map.mapView.getLatLon(0,Main.map.mapView.getHeight());
     
    7379                // Write nodes, make list of ways and relations
    7480                Set<OsmPrimitive> parents = new HashSet<OsmPrimitive>();
    75                 for (Node n : Main.main.getCurrentDataSet().getNodes()) {
     81                for (Node n : ds.getNodes()) {
    7682                    if (n.isUsable() && n.getCoor().isWithin(b)) {
    7783                        parents.addAll(n.getReferrers());
Note: See TracChangeset for help on using the changeset viewer.