diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs index a1c273baeea42..adab76309fe38 100644 --- a/src/libsyntax/json.rs +++ b/src/libsyntax/json.rs @@ -296,7 +296,7 @@ impl DiagnosticSpanLine { h_end: usize) -> DiagnosticSpanLine { DiagnosticSpanLine { - text: fm.get_line(index).unwrap().to_owned(), + text: fm.get_line(index).unwrap_or("").to_owned(), highlight_start: h_start, highlight_end: h_end, }