Fix error when calling getParent (#11252)

This commit is contained in:
Charles Gagnon
2020-07-08 14:23:52 -07:00
committed by GitHub
parent ae908530e2
commit 2a7483c036
2 changed files with 3 additions and 3 deletions

View File

@@ -485,7 +485,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
}
getParent(element?: BookTreeItem): vscode.ProviderResult<BookTreeItem> {
if (element) {
if (element?.uri) {
let parentPath: string;
parentPath = path.join(element.root, Content, element.uri.substring(0, element.uri.lastIndexOf(path.posix.sep)));
if (parentPath === element.root) {