Ignore:
Timestamp:
2015-02-15T21:08:12+01:00 (10 years ago)
Author:
malcolmh
Message:

Catch invalid nodes

Location:
applications/editors/josm/plugins/seachart/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/src/s57/S57map.java

    r30894 r30996  
    757757                                git.nextEdge();
    758758                                while (git.hasNode()) {
    759                                         llon = lon;
    760                                         llat = lat;
    761759                                        node = git.next();
    762                                         lat = node.lat;
    763                                         lon = node.lon;
    764                                         sigma += (lon * Math.sin(llat)) - (llon * Math.sin(lat));
     760                                        if (node != null) {
     761                                                llon = lon;
     762                                                llat = lat;
     763                                                lat = node.lat;
     764                                                lon = node.lon;
     765                                                sigma += (lon * Math.sin(llat)) - (llon * Math.sin(lat));
     766                                        }
    765767                                }
    766768                        }
     
    794796                                                lat = node.lat;
    795797                                                lon = node.lon;
    796                                         } else {
     798                                        } else if (node != null) {
    797799                                                llat = lat;
    798800                                                llon = lon;
  • applications/editors/josm/plugins/seachart/src/seachart/SeachartAction.java

    r30995 r30996  
    149149                                LatLon coor = node.getCoor();
    150150                                if (coor != null) {
    151                                         map.addNode(node.getUniqueId(), node.getCoor().lat(), node.getCoor().lon());
     151                                        map.addNode(node.getUniqueId(), coor.lat(), coor.lon());
    152152                                        for (Entry<String, String> entry : node.getKeys().entrySet()) {
    153153                                                map.addTag(entry.getKey(), entry.getValue());
Note: See TracChangeset for help on using the changeset viewer.