Skip to content

Commit

Permalink
Fix #43466 in 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Feb 13, 2018
1 parent b9cb66d commit 8144fc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vs/workbench/api/node/extHostTreeViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class ExtHostTreeView<T> extends Disposable {
}

const prefix = parentHandle ? parentHandle : ExtHostTreeView.LABEL_HANDLE_PREFIX;
let elementId = label ? label : basename(resourceUri.path);
let elementId = label ? label : (resourceUri ? basename(resourceUri.path) : '');
elementId = elementId.indexOf('/') !== -1 ? elementId.replace('/', '//') : elementId;
const existingHandle = this.nodes.has(element) ? this.nodes.get(element).handle : void 0;

Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/browser/parts/views/treeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class TreeRenderer implements IRenderer {

public renderElement(tree: ITree, node: ITreeItem, templateId: string, templateData: ITreeExplorerTemplateData): void {
const resource = node.resourceUri ? URI.revive(node.resourceUri) : null;
const name = node.label || basename(resource.path);
const name = node.label ? node.label : (resource ? basename(resource.path) : '');
const icon = this.themeService.getTheme().type === LIGHT ? node.icon : node.iconDark;

// reset
Expand Down

0 comments on commit 8144fc9

Please sign in to comment.