diff --git a/src/format.jule b/src/format.jule index dd93153..6a74440 100644 --- a/src/format.jule +++ b/src/format.jule @@ -1065,8 +1065,10 @@ impl ScopeFormatter { match type it.kind { | &ast::WhileKind: let mut wk = (&ast::WhileKind)(it.kind) - self.fmt.pop_row_comments_by_c(wk.expr.token.row, wk.expr.token.column) - self.fmt.format_expr(wk.expr) + if wk.expr != nil { + self.fmt.pop_row_comments_by_c(wk.expr.token.row, wk.expr.token.column) + self.fmt.format_expr(wk.expr) + } if wk.next != nil { self.write("; ") self.format_stmt(wk.next)