提交 f56d0802 编写于 作者: B Benjamin Pasero

fix npe

上级 d0668fb1
...@@ -210,14 +210,19 @@ export class FileLabel extends ResourceLabel { ...@@ -210,14 +210,19 @@ export class FileLabel extends ResourceLabel {
} }
public setFile(resource: uri, options?: IFileLabelOptions): void { public setFile(resource: uri, options?: IFileLabelOptions): void {
const hideLabel = options && options.hideLabel;
let name: string; let name: string;
if (options && options.hideLabel) { if (!hideLabel) {
name = void 0; if (options && options.fileKind === FileKind.ROOT_FOLDER) {
} else if (options && options.fileKind === FileKind.ROOT_FOLDER) { const workspaceFolder = this.contextService.getWorkspaceFolder(resource);
const workspaceFolder = this.contextService.getWorkspaceFolder(resource); if (workspaceFolder) {
name = workspaceFolder.name; name = workspaceFolder.name;
} else { }
name = paths.basename(resource.fsPath); }
if (!name) {
name = paths.basename(resource.fsPath);
}
} }
let description: string; let description: string;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册