Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java	(revision 11919)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java	(revision 11920)
@@ -176,4 +176,9 @@
 	System.out.println("After removing duplicate nodes, "+nodelist.size()+" nodes remain.");
 	  
+	
+	// if for some reason (image loading failed, ...) nodelist is empty, no more processing required.
+	if (nodelist.size() == 0) {
+		return;
+	}
 	
 	/**
Index: /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java
===================================================================
--- /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java	(revision 11919)
+++ /applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java	(revision 11920)
@@ -123,5 +123,5 @@
 	        	// Read from a URL
 	        	URL url = new URL(urlloc);
-	        	this.image = ImageIO.read(url);
+	        	this.image = ImageIO.read(url); // this can return null!
 	        } catch(MalformedURLException e){
 	        	System.out.println(e.getMessage());
@@ -132,8 +132,10 @@
 		    }
 	        
-	        this.images.add(this.image);
-	        this.imageindex.put(hashkey,this.images.size()-1);
-	        
-	        this.saveimage(file,this.image);
+	        if (this.image != null) {
+		        this.images.add(this.image);
+		        this.imageindex.put(hashkey,this.images.size()-1);
+		        
+		        this.saveimage(file,this.image);
+	        }
 	    }
 	    
