Skip to content

Commit f1f1684

Browse files
Copilotalexr00
andcommitted
Fix compilation errors from optional checkboxState
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 76b9db0 commit f1f1684

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/view/treeNodes/directoryTreeNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class DirectoryTreeNode extends TreeNode implements vscode.TreeItem {
124124
if (!child.allChildrenViewed()) {
125125
return false;
126126
}
127-
} else if (child.checkboxState.state !== vscode.TreeItemCheckboxState.Checked) {
127+
} else if (!child.checkboxState || child.checkboxState.state !== vscode.TreeItemCheckboxState.Checked) {
128128
return false;
129129
}
130130
}

src/view/treeNodes/treeUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ export namespace TreeUtils {
3535
continue;
3636
}
3737
if (!checkedNodes.includes(selected) && !uncheckedNodes.includes(selected)) {
38-
if (selected.checkboxState.state === vscode.TreeItemCheckboxState.Unchecked) {
38+
if (selected.checkboxState?.state === vscode.TreeItemCheckboxState.Unchecked) {
3939
checkedNodes.push(selected);
40-
} else {
40+
} else if (selected.checkboxState?.state === vscode.TreeItemCheckboxState.Checked) {
4141
uncheckedNodes.push(selected);
4242
}
4343
}

0 commit comments

Comments
 (0)