Skip to content

Commit 0871dc1

Browse files
Add null check for customTags setting (#955)
Fixes #807 Signed-off-by: David Thompson <[email protected]> Co-authored-by: Muthurajan Sivasubramanian <[email protected]>
1 parent 0e17579 commit 0871dc1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/languageservice/services/yamlCompletion.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export class YamlCompletion {
293293
proposed,
294294
};
295295

296-
if (this.customTags.length > 0) {
296+
if (this.customTags && this.customTags.length > 0) {
297297
this.getCustomTagValueCompletions(collector);
298298
}
299299

test/autoCompletion.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -3126,5 +3126,10 @@ describe('Auto Completion Tests', () => {
31263126
expect(result.items.map((i) => i.label)).to.have.members(['fruit', 'vegetable']);
31273127
});
31283128
});
3129+
it('Should function when settings are undefined', async () => {
3130+
languageService.configure({ completion: true });
3131+
const content = '';
3132+
await parseSetup(content, 0);
3133+
});
31293134
});
31303135
});

0 commit comments

Comments
 (0)