Skip to content

Commit

Permalink
compiler: fix pretty print crash on wrong parent references
Browse files Browse the repository at this point in the history
  • Loading branch information
badicsalex committed Feb 20, 2025
1 parent 9533dd1 commit 68a1f3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/compiler/llr/pretty_print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ impl<T> Display for DisplayPropertyRef<'_, T> {
}
PropertyReference::InParent { level, parent_reference } => {
for _ in 0..level.get() {
if ctx.parent.is_none() {
return write!(f, "<invalid parent reference>");
}
ctx = ctx.parent.unwrap().ctx;
}
write!(f, "{}", Self(parent_reference, ctx))
Expand Down

0 comments on commit 68a1f3c

Please sign in to comment.