check if possible parent exists before checking if it contains another element

This commit is contained in:
ansuz
2016-02-29 15:27:11 +01:00
parent 67bdb8a65a
commit 5425699f43

View File

@@ -96,7 +96,7 @@ define([], function () {
// not being used internally, but is useful externally
tree.contains = function (el, root) {
return el && root.contains && root.contains(el);
return el && root && root.contains && root.contains(el);
};
var siblingCount = tree.siblingCount = function (el) {