From 7465a15f87303425a4d6a04eca86f55a99d99c19 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Wed, 13 Aug 2014 14:42:29 +0200 Subject: [PATCH] Bug 1052756 - Fix Toolbox.destroy() to properly clean up with add-on targets r=Mossop --- browser/devtools/framework/toolbox.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/browser/devtools/framework/toolbox.js b/browser/devtools/framework/toolbox.js index 1d3c7deb4635..b4bb85dba1dd 100644 --- a/browser/devtools/framework/toolbox.js +++ b/browser/devtools/framework/toolbox.js @@ -1358,8 +1358,10 @@ Toolbox.prototype = { // Destroying the walker and inspector fronts outstanding.push(this.destroyInspector().then(() => { // Removing buttons - this._pickerButton.removeEventListener("command", this._togglePicker, false); - this._pickerButton = null; + if (this._pickerButton) { + this._pickerButton.removeEventListener("command", this._togglePicker, false); + this._pickerButton = null; + } })); // Remove the host UI