Skip to content

Commit

Permalink
unreal_asset: [kismet] fix KismetExpression read_arr error propagation
Browse files Browse the repository at this point in the history
fixes #96
  • Loading branch information
localcc committed Aug 29, 2023
1 parent bff4ff9 commit b64d3f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions unreal_asset/unreal_asset_kismet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,12 +1106,12 @@ impl KismetExpression {
end_token: EExprToken,
) -> Result<Vec<Self>, Error> {
let mut data = Vec::new();
let mut current_expr: Option<KismetExpression> = None;
while current_expr.is_none() || !current_expr.as_ref().unwrap().enum_eq(&end_token) {
if let Some(expr) = current_expr {
data.push(expr);
loop {
let expr = KismetExpression::new(asset)?;
if expr.enum_eq(&end_token) {
break;
}
current_expr = KismetExpression::new(asset).ok();
data.push(expr);
}
Ok(data)
}
Expand Down

0 comments on commit b64d3f4

Please sign in to comment.