Skip to content

Commit

Permalink
fix: handle undefined stats
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Nov 10, 2023
1 parent 221ee2e commit 66e6d97
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function tryGetDiagnostics(

try {
const res = await svelteDoc.getCompiled();
return (((res.stats as any).warnings || res.warnings || []) as Warning[])
return (((res.stats as any)?.warnings || res.warnings || []) as Warning[])
.filter((warning) => settings[warning.code] !== 'ignore')
.map((warning) => {
const start = warning.start || { line: 1, column: 0 };
Expand Down

0 comments on commit 66e6d97

Please sign in to comment.