Bug 894713 - Followup fix, don't call removeEventListener on targetElement if targetElement is null. Fixes spurious console errors while running tests. r=me
authorJim Mathies <jmathies@mozilla.com>
Thu, 25 Jul 2013 19:39:43 -0500
changeset 140046 b5aa56bc292beb9e769afe67097c86041597d465
parent 140045 639f164cc46ed3e84f1ecf10f0d83f3804a2019c
child 140047 c10c0a6270ecbf817fe472b8dc04d195b6900d28
push id31581
push userjmathies@mozilla.com
push dateFri, 26 Jul 2013 00:41:01 +0000
treeherdermozilla-inbound@b5aa56bc292b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs894713
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 894713 - Followup fix, don't call removeEventListener on targetElement if targetElement is null. Fixes spurious console errors while running tests. r=me
browser/metro/base/content/helperui/ChromeSelectionHandler.js
--- a/browser/metro/base/content/helperui/ChromeSelectionHandler.js
+++ b/browser/metro/base/content/helperui/ChromeSelectionHandler.js
@@ -272,18 +272,20 @@ var ChromeSelectionHandler = {
    * _closeSelection
    *
    * Shuts SelectionHandler down.
    */
   _closeSelection: function _closeSelection() {
     this._clearTimers();
     this._cache = null;
     this._contentWindow = null;
-    this._targetElement.removeEventListener("blur", this, true);
-    this._targetElement = null;
+    if (this._targetElement) {
+      this._targetElement.removeEventListener("blur", this, true);
+      this._targetElement = null;
+    }
     this._selectionMoveActive = false;
     this._domWinUtils = null;
     this._targetIsEditable = false;
     this.sendAsync("Content:HandlerShutdown", {});
   },
 
   get hasSelection() {
     if (!this._targetElement) {