From cc619fd7d444af16bb02c34b9a246affcf1e09ce Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 24 Mar 2021 11:12:38 +0100 Subject: [PATCH] Fix reporting error without span such as error from the interpreter that the file cannot be loaded --- sixtyfps_compiler/diagnostics.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sixtyfps_compiler/diagnostics.rs b/sixtyfps_compiler/diagnostics.rs index 45efbcce6..1efffa543 100644 --- a/sixtyfps_compiler/diagnostics.rs +++ b/sixtyfps_compiler/diagnostics.rs @@ -310,7 +310,9 @@ impl BuildDiagnostics { .inner .into_iter() .filter_map(|d| { - let spans = if let Some(sf) = &d.span.source_file { + let spans = if !d.span.span.is_valid() { + vec![] + } else if let Some(sf) = &d.span.source_file { if let Some(ref mut handle_no_source) = handle_no_source { if sf.source.is_none() { handle_no_source(d);