Changeset 9817 in josm for trunk/src


Ignore:
Timestamp:
2016-02-17T22:05:02+01:00 (9 years ago)
Author:
Don-vip
Message:

fix coverity defect 1351474 (division by zero), add unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java

    r9804 r9817  
    8181                latcnt++;
    8282            }
     83        }
     84        if (latcnt == 0) {
     85            return null;
    8386        }
    8487        double avglat = latsum / latcnt;
     
    190193    @Override
    191194    public void actionPerformed(ActionEvent e) {
    192         Main.worker.submit(createTask());
     195        PleaseWaitRunnable task = createTask();
     196        if (task != null) {
     197            Main.worker.submit(task);
     198        }
    193199    }
    194200}
Note: See TracChangeset for help on using the changeset viewer.