Skip to content

Commit d82d4b6

Browse files
committed
tolerate None return from get_line
1 parent 2bade81 commit d82d4b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libsyntax/json.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl DiagnosticSpanLine {
296296
h_end: usize)
297297
-> DiagnosticSpanLine {
298298
DiagnosticSpanLine {
299-
text: fm.get_line(index).unwrap().to_owned(),
299+
text: fm.get_line(index).unwrap_or("").to_owned(),
300300
highlight_start: h_start,
301301
highlight_end: h_end,
302302
}

0 commit comments

Comments
 (0)