[Pkg-mozext-commits] [tabmixplus] 29/48: Add check for the case node.parentNode is missing

David Prévot taffit at moszumanska.debian.org
Sun Aug 20 03:14:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit bbac38e8520fad98fd9d4aca39976ec0eba9a338
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sat Aug 12 09:50:39 2017 +0300

    Add check for the case node.parentNode is missing
---
 modules/LinkNodeUtils.jsm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/LinkNodeUtils.jsm b/modules/LinkNodeUtils.jsm
index 5dc97ee..b7ffe92 100644
--- a/modules/LinkNodeUtils.jsm
+++ b/modules/LinkNodeUtils.jsm
@@ -44,7 +44,7 @@ this.LinkNodeUtils = {
         location: {href: doc.location ? doc.location.href : ""}
       },
       parentNode: {
-        baseURI: node.parentNode.baseURI,
+        baseURI: node.parentNode ? node.parentNode.baseURI : '',
         _attributes: getAttributes(node.parentNode, ["onclick"])
       },
       _focusedWindowHref: focusedWindow.top.location.href,
@@ -106,6 +106,9 @@ this.LinkNodeUtils = {
 };
 
 function getAttributes(node, attribs) {
+  if (!node) {
+    return {};
+  }
   let wrapper = {};
   for (let att of attribs) {
     if (node.hasAttribute(att)) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list