From d8a0e703b2f5899777339a8d9eb02cd9a69e2fd1 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtentun.org> Date: Fri, 19 Jun 2009 11:35:41 -0400 Subject: [PATCH] Bug 499277: Once unzoomed, dblClick can throw an error - aElement is null, r=mfinkle --- mobile/chrome/content/InputHandler.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mobile/chrome/content/InputHandler.js b/mobile/chrome/content/InputHandler.js index 97561db76d2..1e5985e3186 100644 --- a/mobile/chrome/content/InputHandler.js +++ b/mobile/chrome/content/InputHandler.js @@ -718,7 +718,7 @@ function ContentClickingModule(owner) { this._owner = owner; this._clickTimeout = -1; this._events = []; - this._zoomed = false; + this._zoomedTo = null; } ContentClickingModule.prototype = { @@ -798,12 +798,14 @@ ContentClickingModule.prototype = { let firstEvent = this._events[0].event; let zoomElement = optimalElementForPoint(firstEvent.clientX, firstEvent.clientY); - if (zoomElement != this._zoomedTo) { - this._zoomedTo = zoomElement; - Browser.canvasBrowser.zoomToElement(zoomElement); - } else { - this._zoomedTo = null; - Browser.canvasBrowser.zoomFromElement(zoomElement); + if (zoomElement) { + if (zoomElement != this._zoomedTo) { + this._zoomedTo = zoomElement; + Browser.canvasBrowser.zoomToElement(zoomElement); + } else { + this._zoomedTo = null; + Browser.canvasBrowser.zoomFromElement(zoomElement); + } } this._owner.ungrab(this);