From 42e0c7a4202fdd4594fb50afb1aeec77332cae0a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 28 Jan 2019 18:48:56 +0300 Subject: [PATCH] feedTree: amend previous to check that nodes are actually there --- js/FeedTree.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/FeedTree.js b/js/FeedTree.js index b20b5eb20..489aedaf0 100755 --- a/js/FeedTree.js +++ b/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);