From 39f56d4fd17b5ba9411bab1e28a3b0955dc17fa8 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 23 Feb 2016 15:53:58 +0100 Subject: [PATCH] throw error when checking for the index of a node that has no parent. it probably isn't in the dom if this is the case. Check if it's there before using this function --- www/common/treesome.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/common/treesome.js b/www/common/treesome.js index 08743b1c7..6fd504a56 100644 --- a/www/common/treesome.js +++ b/www/common/treesome.js @@ -89,6 +89,7 @@ define([], function () { var indexOfNode = tree.indexOfNode = function (el) { if (!(el && el.parentNode)) { console.log("No parentNode found!"); + throw new Error('No parentNode found!'); } return Array.prototype.indexOf.call(el.parentNode.childNodes, el); };