Ignore:
Timestamp:
2009-07-08T15:26:12+02:00 (17 years ago)
Author:
stoecker
Message:

close #2874 (NPE), improved external style handling

Location:
trunk/src/org/openstreetmap/josm/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java

    r1728 r1747  
    1616        super(coor.lat(), coor.lon());
    1717        proj = null;
     18    }
     19
     20    public CachedLatLon(EastNorth eastNorth) {
     21        super(Main.proj.eastNorth2latlon(eastNorth));
     22        proj = Main.proj;
     23        this.eastNorth = eastNorth;
    1824    }
    1925
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r1731 r1747  
    3737
    3838    public final void setEastNorth(EastNorth eastNorth) {
    39         coor.setEastNorth(eastNorth);
     39        if(eastNorth != null)
     40        {
     41            if(coor != null)
     42                coor.setEastNorth(eastNorth);
     43            else
     44                coor = new CachedLatLon(eastNorth);
     45        }
    4046    }
    4147
    4248    public final EastNorth getEastNorth() {
    43         return coor.getEastNorth();
     49        return coor != null ? coor.getEastNorth() : null;
    4450    }
    4551
Note: See TracChangeset for help on using the changeset viewer.