From aa5358203e63432ed45e8c098e973408035911af Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 18 Nov 2013 10:43:37 +0100 Subject: [PATCH] Protect from null vertexFeature When dragging the map before a vertexFeature was created, it can be null, so we cannot get its renderIntent. --- src/ol/interaction/modifyinteraction.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index 4d0ed9da84..8acb9ca9a3 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -336,9 +336,9 @@ ol.interaction.Modify.prototype.createOrUpdateVertexFeature_ = ol.interaction.Modify.prototype.handleDragStart = function(evt) { this.dragSegments_ = []; var vertexFeature = this.vertexFeature_; - var renderIntent = vertexFeature.getRenderIntent(); - if (goog.isDef(vertexFeature) && - renderIntent != ol.layer.VectorLayerRenderIntent.HIDDEN) { + if (!goog.isNull(vertexFeature) && vertexFeature.getRenderIntent() != + ol.layer.VectorLayerRenderIntent.HIDDEN) { + var renderIntent = vertexFeature.getRenderIntent(); var insertVertices = []; var vertex = vertexFeature.getGeometry().getCoordinates(); var vertexExtent = ol.extent.boundingExtent([vertex]);