Skip to content

Commit

Permalink
Interpreter: fix panic when accessed variable which doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest1338 committed Jan 27, 2025
1 parent d479d5e commit c55f702
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Interpreter {
// If it's a valid variable, print it
// Probably only useful in the interactive mode
// Should we only restrict this code to such condition?
let var = self.get_var(id).unwrap();
let var = self.get_var(id)?;
println!("{var}");
}
_ => {
Expand Down

0 comments on commit c55f702

Please sign in to comment.