Check if the sketch feature is defined in finishDrawing

Fixes #7035
This commit is contained in:
Frederic Junod
2018-01-29 16:07:14 +01:00
parent 62bc7b75d7
commit 70b0d5d1cc
2 changed files with 58 additions and 7 deletions

View File

@@ -714,6 +714,9 @@ Draw.prototype.removeLastPoint = function() {
*/
Draw.prototype.finishDrawing = function() {
const sketchFeature = this.abortDrawing_();
if (!sketchFeature) {
return;
}
let coordinates = this.sketchCoords_;
const geometry = /** @type {ol.geom.SimpleGeometry} */ (sketchFeature.getGeometry());
if (this.mode_ === Draw.Mode_.LINE_STRING) {