Index: /applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java
===================================================================
--- /applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java	(revision 29636)
+++ /applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java	(revision 29637)
@@ -26,4 +26,5 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -53,4 +54,9 @@
         @Override
 		public void actionPerformed(ActionEvent e) {
+            DataSet ds = Main.main.getCurrentDataSet();
+            if (ds == null) {
+                return;
+            }
+            
             // get all stuff visible on screen
             LatLon bottomLeft = Main.map.mapView.getLatLon(0,Main.map.mapView.getHeight());
@@ -73,5 +79,5 @@
                 // Write nodes, make list of ways and relations
                 Set<OsmPrimitive> parents = new HashSet<OsmPrimitive>();
-                for (Node n : Main.main.getCurrentDataSet().getNodes()) {
+                for (Node n : ds.getNodes()) {
                     if (n.isUsable() && n.getCoor().isWithin(b)) {
                         parents.addAll(n.getReferrers());
