Ignore:
Timestamp:
2009-08-10T00:05:42+02:00 (15 years ago)
Author:
stoecker
Message:

fixed NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/action/SetWaypointAction.java

    r13497 r16948  
    5959        if(source instanceof JToggleButton) {
    6060            if(((JToggleButton)source).isSelected()) {
    61                 markerTitle = markerTitle + " " + tr("start");
     61                markerTitle = tr("{0} start", markerTitle);
    6262            } else {
    63                 markerTitle = markerTitle + " " + tr("end");
     63                markerTitle = tr("{0} end", markerTitle);
    6464            }
    6565        }
     
    8484        WayPoint waypoint = new WayPoint(event.getCoordinates());
    8585        waypoint.attr.put("name", markerText);
    86         waypoint.attr.put("sym", iconName);
     86        if(iconName != null)
     87            waypoint.attr.put("sym", iconName);
    8788        synchronized(LiveGpsLock.class) {
    8889            //layer.data.add(new Marker(event.getCoordinates(), markerText, iconName));
    89         layer.data.add(new Marker(event.getCoordinates(), markerText, iconName, null, -1.0, 0.0));
     90            layer.data.add(new Marker(event.getCoordinates(), markerText, iconName, null, -1.0, 0.0));
    9091            if(gpsLayer != null) {
    9192                gpsLayer.data.waypoints.add(waypoint);
     
    107108                // not found, add a new one
    108109                //markerLayer = new MarkerLayer(new GpxData(), MARKER_LAYER_NAME, null);
    109         markerLayer = new MarkerLayer(new GpxData(), MARKER_LAYER_NAME, null, null);
     110                markerLayer = new MarkerLayer(new GpxData(), MARKER_LAYER_NAME, null, null);
    110111                Main.main.addLayer(markerLayer);
    111112            }
Note: See TracChangeset for help on using the changeset viewer.