From fbc810264bcec5d6ca2b42b5981c26b6ba0265c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 10 Oct 2012 20:25:53 +0200 Subject: [PATCH] goog.array.forEach does not accept null values --- src/ol/mapbrowserevent.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; + } };