diff --git a/src/ol/mapbrowserevent.js b/src/ol/mapbrowserevent.js index b5b8d49481..a2d241eda9 100644 --- a/src/ol/mapbrowserevent.js +++ b/src/ol/mapbrowserevent.js @@ -285,9 +285,10 @@ ol.MapBrowserEventHandler.prototype.disposeInternal = function() { this.handleUp_, false, this); goog.events.unlisten(element, goog.events.EventType.CLICK, this.click_, false, this); - goog.asserts.assert(goog.isDef(this.dragListenerKeys_)); - goog.array.forEach(this.dragListenerKeys_, goog.events.unlistenByKey); - this.dragListenerKeys_ = null; + if (!goog.isNull(this.dragListenerKeys_)) { + goog.array.forEach(this.dragListenerKeys_, goog.events.unlistenByKey); + this.dragListenerKeys_ = null; + } };