From a405279f340bfca0525f1d46e1cbbfcd1bdfe5be Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 24 Jun 2013 10:35:02 +0200 Subject: [PATCH] Click handler called with empty event object on Android On Android (both native browser and Chrome), the handleTouchEnd_ method is sometimes reached in a state where this.down_ is null. This check protects against this.click_ being called without an event object. To see this issue, open any example in Android, and tap the zoom + or - button. --- src/ol/mapbrowserevent.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ol/mapbrowserevent.js b/src/ol/mapbrowserevent.js index eadac888fb..a277ea6057 100644 --- a/src/ol/mapbrowserevent.js +++ b/src/ol/mapbrowserevent.js @@ -373,7 +373,9 @@ ol.MapBrowserEventHandler.prototype.handleTouchEnd_ = function(browserEvent) { } else { this.timestamp_ = 0; } - this.click_(this.down_); + if (!goog.isNull(this.down_)) { + this.click_(this.down_); + } } this.down_ = null; };