Skip to content

Commit

Permalink
Fixed tree related issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
akshay-joshi committed Sep 16, 2024
1 parent dd6f6cf commit 53760db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion web/pgadmin/static/js/components/PgTree/FileTreeX/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,9 @@ export class FileTreeX extends React.Component<IFileTreeXProps> {
const scrollXPos = scrollX || 0;
const scrollYPos = scrollY || this.props.model.state.scrollOffset;
const div = this.wrapperRef.current.querySelector('div').querySelector('div') as HTMLDivElement;
div.scroll(scrollXPos, scrollYPos);
if (div) {
div.scroll(scrollXPos, scrollYPos);
}

};

Expand Down
2 changes: 1 addition & 1 deletion web/pgadmin/static/js/tree/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export class Tree {
let result = {};
if (identifier === undefined) return;
let item = TreeNode.prototype.isPrototypeOf(identifier) ? identifier : this.findNode(identifier.path);
if (item === undefined) return;
if (!item) return;
do {
const currentNodeData = item.getData();
if (currentNodeData._type in this.Nodes && this.Nodes[currentNodeData._type].hasId) {
Expand Down

0 comments on commit 53760db

Please sign in to comment.