diff options
Diffstat (limited to 'cli/fmt_errors.rs')
-rw-r--r-- | cli/fmt_errors.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/fmt_errors.rs b/cli/fmt_errors.rs index 953dfec8b..3016e0ff4 100644 --- a/cli/fmt_errors.rs +++ b/cli/fmt_errors.rs @@ -48,8 +48,9 @@ pub fn format_location(frame: &JsStackFrame) -> String { return cyan("native").to_string(); } let mut result = String::new(); - if let Some(file_name) = &frame.file_name { - result += &cyan(&format_file_name(file_name)).to_string(); + let file_name = frame.file_name.clone().unwrap_or_default(); + if !file_name.is_empty() { + result += &cyan(&format_file_name(&file_name)).to_string(); } else { if frame.is_eval { result += |