Ignore:
Timestamp:
2017-10-25T20:40:35+02:00 (7 years ago)
Author:
donvip
Message:

fix #josm15482 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java

    r33583 r33730  
    386386        // free mouse-drawing
    387387        if (nearSomeNode) {
    388             if (settings.snapNodes && Math.hypot(e.getX() - lastP.x, e.getY() - lastP.y) > 1e-2) {
     388            if (settings.snapNodes && lastP != null && Math.hypot(e.getX() - lastP.x, e.getY() - lastP.y) > 1e-2) {
    389389                line.addFixed(nd1.getCoor()); // snap to node coords
    390390                repaint();
     
    392392            }
    393393        } else {
    394             if (Math.hypot(e.getX() - lastP.x, e.getY() - lastP.y) > settings.minPixelsBetweenPoints) {
     394            if (lastP != null && Math.hypot(e.getX() - lastP.x, e.getY() - lastP.y) > settings.minPixelsBetweenPoints) {
    395395                line.addLast(getLatLon(e)); // add new point
    396396                repaint();
Note: See TracChangeset for help on using the changeset viewer.