Skip to content

Commit f32af86

Browse files
committed
Fix undefined bug
1 parent 8ddf15e commit f32af86

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vs/workbench/services/editor/common/customEditorLabelService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class CustomEditorLabelService extends Disposable implements ICustomEdito
4040
private patterns: ICustomEditorLabelPattern[] = [];
4141
private enabled = true;
4242

43-
private cache = new MRUCache<string, string | undefined>(1000);
43+
private cache = new MRUCache<string, string | null>(1000);
4444

4545
constructor(
4646
@IConfigurationService private readonly configurationService: IConfigurationService,
@@ -123,11 +123,11 @@ export class CustomEditorLabelService extends Disposable implements ICustomEdito
123123
const key = resource.toString();
124124
const cached = this.cache.get(key);
125125
if (cached !== undefined) {
126-
return cached;
126+
return cached ?? undefined;
127127
}
128128

129129
const result = this.applyPatterns(resource);
130-
this.cache.set(key, result);
130+
this.cache.set(key, result ?? null);
131131

132132
return result;
133133
}

0 commit comments

Comments
 (0)