From 081dd1f2c0cb3b0cdf55fd419cd4b9d164b0d2ad Mon Sep 17 00:00:00 2001 From: kamilbukum Date: Sun, 6 May 2018 05:29:00 +0300 Subject: [PATCH] * fixed *undefined* problem when used variables value with *isImportant* key. --- lib/find-node-ancestor-with-selector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/find-node-ancestor-with-selector.js b/lib/find-node-ancestor-with-selector.js index 0960e66..7d39888 100644 --- a/lib/find-node-ancestor-with-selector.js +++ b/lib/find-node-ancestor-with-selector.js @@ -8,7 +8,7 @@ var findNodeAncestorWithSelector = function(selector, node) { // Keep going until we run out of parents to search // or we found the node var currentNode = node; - while(currentNode.parent && !matchingNode) { + while(currentNode && currentNode.parent && !matchingNode) { // A trick to get the selector split up. Generate a scope list on a clone(clean parent) var currentNodeScopeList = generateScopeList(currentNode.clone(), true);