提交 433c6245 编写于 作者: S Sandeep Somavarapu

Fix #43466

上级 e7208c05
......@@ -197,7 +197,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;
......
......@@ -404,7 +404,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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册