Skip to content

Commit 66e6d97

Browse files
committed
fix: handle undefined stats
1 parent 221ee2e commit 66e6d97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/language-server/src/plugins/svelte/features/getDiagnostics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function tryGetDiagnostics(
4545

4646
try {
4747
const res = await svelteDoc.getCompiled();
48-
return (((res.stats as any).warnings || res.warnings || []) as Warning[])
48+
return (((res.stats as any)?.warnings || res.warnings || []) as Warning[])
4949
.filter((warning) => settings[warning.code] !== 'ignore')
5050
.map((warning) => {
5151
const start = warning.start || { line: 1, column: 0 };

0 commit comments

Comments
 (0)