Skip to content

Commit 0223d29

Browse files
authored
fix: handle missing FSM asset gracefully (#145)
1 parent 2522f01 commit 0223d29

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • crates/bevy_animation_graph_builtin_nodes/src

crates/bevy_animation_graph_builtin_nodes/src/fsm_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl NodeLike for FsmNode {
3434
.resources
3535
.state_machine_assets
3636
.get(&self.fsm)
37-
.unwrap();
37+
.ok_or(GraphError::FsmAssetMissing)?;
3838
fsm.get_low_level_fsm().update(ctx)?;
3939

4040
Ok(())
@@ -46,7 +46,7 @@ impl NodeLike for FsmNode {
4646
.resources
4747
.state_machine_assets
4848
.get(&self.fsm)
49-
.unwrap();
49+
.ok_or(GraphError::FsmAssetMissing)?;
5050
fsm.get_low_level_fsm().time_update(ctx, pin)
5151
}
5252

0 commit comments

Comments
 (0)