Ticket #1663: lakewalker_exception_1663.patch
| File lakewalker_exception_1663.patch, 1.7 KB (added by , 17 years ago) |
|---|
-
src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerWMS.java
122 122 123 123 // Read from a URL 124 124 URL url = new URL(urlloc); 125 this.image = ImageIO.read(url); 125 this.image = ImageIO.read(url); // this can return null! 126 126 } catch(MalformedURLException e){ 127 127 System.out.println(e.getMessage()); 128 128 } catch(IOException e){ … … 131 131 System.out.println(e.getMessage()); 132 132 } 133 133 134 this.images.add(this.image); 135 this.imageindex.put(hashkey,this.images.size()-1); 136 137 this.saveimage(file,this.image); 134 if (this.image != null) { 135 this.images.add(this.image); 136 this.imageindex.put(hashkey,this.images.size()-1); 137 138 this.saveimage(file,this.image); 139 } 138 140 } 139 141 140 142 this.imagex = bottom_left_xy[0]; -
src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java
176 176 System.out.println("After removing duplicate nodes, "+nodelist.size()+" nodes remain."); 177 177 178 178 179 // if for some reason (image loading failed, ...) nodelist is empty, no more processing required. 180 if (nodelist.size() == 0) { 181 return; 182 } 183 179 184 /** 180 185 * Turn the arraylist into osm nodes 181 186 */
