Browse Source

feedTree: amend previous to check that nodes are actually there

Andrew Dolgov 1 month ago
parent
commit
42e0c7a420
1 changed files with 5 additions and 3 deletions
  1. 5 3
      js/FeedTree.js

+ 5 - 3
js/FeedTree.js

@@ -276,9 +276,11 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"],
 					const node = treeNode.rowNode;
 					const tree = this.domNode;
 
-					// scroll tree to selection if needed
-					if (node.offsetTop < tree.scrollTop || node.offsetTop > tree.scrollTop + tree.clientHeight) {
-						$("feedTree").scrollTop = node.offsetTop;
+					if (node && tree) {
+						// scroll tree to selection if needed
+						if (node.offsetTop < tree.scrollTop || node.offsetTop > tree.scrollTop + tree.clientHeight) {
+							$("feedTree").scrollTop = node.offsetTop;
+						}
 					}
 
 				}, 0);