Bug 1499985 - Fix error in canRewind; r=miker.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Fri, 19 Oct 2018 08:15:08 +0000
changeset 490435 462a889b96ca175b528d6d5a00966dd68ae66fae
parent 490434 9a5870920ce33ae704c94615d6bc8ed43a7475da
child 490436 ad81b437f8604c61701ae3a3112b8490577308eb
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersmiker
bugs1499985
milestone64.0a1
Bug 1499985 - Fix error in canRewind; r=miker. hud.owner can be null in some condition, so we need to guard the access to hud.owner.target. Differential Revision: https://phabricator.services.mozilla.com/D9069
devtools/client/webconsole/webconsole-output-wrapper.js
--- a/devtools/client/webconsole/webconsole-output-wrapper.js
+++ b/devtools/client/webconsole/webconsole-output-wrapper.js
@@ -61,17 +61,17 @@ WebConsoleOutputWrapper.prototype = {
             timeStamp,
           }]));
         },
         hudProxy: hud.proxy,
         openLink: (url, e) => {
           hud.owner.openLink(url, e);
         },
         canRewind: () => {
-          if (!hud.owner.target.activeTab) {
+          if (!(hud.owner && hud.owner.target && hud.owner.target.activeTab)) {
             return false;
           }
 
           return hud.owner.target.activeTab.traits.canRewind;
         },
         createElement: nodename => {
           return this.document.createElement(nodename);
         },