From 22aa33904716fa77f4a2c719b6be790c0e0450cc Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Sat, 20 Feb 2016 17:59:52 +0900 Subject: [PATCH] Suppress errors from missing nodes --- modules/browser.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/browser.js b/modules/browser.js index 735099e2..a9093b16 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -1231,15 +1231,16 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { var foundContainers = []; var containers = [ - namedNodes.twistyAnchor.parentNode, - namedNodes.label.parentNode, - namedNodes.counter.parentNode, - namedNodes.closeAnchor.parentNode + namedNodes.twistyAnchor && namedNodes.twistyAnchor.parentNode, + namedNodes.label && namedNodes.label.parentNode, + namedNodes.counter && namedNodes.counter.parentNode, + namedNodes.closeAnchor && namedNodes.closeAnchor.parentNode ]; for (let i = 0, maxi = containers.length; i < maxi; i++) { let container = containers[i]; - if (foundContainers.indexOf(container) > -1) + if (!container || + foundContainers.indexOf(container) > -1) continue; this.initTabContentsOrderInternal(container, namedNodes, aForce); foundContainers.push(container);