From 9894ceda2acb3d0e0de246fa7fb65281d271c58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 22 Sep 2015 16:28:21 +0200 Subject: [PATCH] Remove bogus assertion This commit removes an incorrect assertion from the modify interaction, which currently triggers when adding vertices to a line string. A new condition is added to the `if` statement to prevent a compilation error. In practice, `depth` and `segmentDataMatch.depth` are either both defined or both undefined. --- src/ol/interaction/modifyinteraction.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ol/interaction/modifyinteraction.js b/src/ol/interaction/modifyinteraction.js index 7914ff6509..d2d17210e5 100644 --- a/src/ol/interaction/modifyinteraction.js +++ b/src/ol/interaction/modifyinteraction.js @@ -973,9 +973,8 @@ ol.interaction.Modify.prototype.setGeometryCoordinates_ = ol.interaction.Modify.prototype.updateSegmentIndices_ = function( geometry, index, depth, delta) { this.rBush_.forEachInExtent(geometry.getExtent(), function(segmentDataMatch) { - goog.asserts.assert(goog.isDef(segmentDataMatch.depth)); if (segmentDataMatch.geometry === geometry && - (!goog.isDef(depth) || + (!goog.isDef(depth) || !goog.isDef(segmentDataMatch.depth) || goog.array.equals(segmentDataMatch.depth, depth)) && segmentDataMatch.index > index) { segmentDataMatch.index += delta;