Skip to content

Commit e05bd97

Browse files
committed
Fix hang on missing state update handler
1 parent 509b138 commit e05bd97

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

crates/bevy_ecs/src/schedule/state.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,15 @@ impl<T: Resource + Clone> Stage for StateStage<T> {
132132
{
133133
enter_next.run(world, resources);
134134
}
135-
} else if let Some(update_current) = self
136-
.stages
137-
.get_mut(&current_stage)
138-
.and_then(|stage| stage.update.as_mut())
139-
{
140-
update_current.run(world, resources);
135+
} else {
136+
if let Some(update_current) = self
137+
.stages
138+
.get_mut(&current_stage)
139+
.and_then(|stage| stage.update.as_mut())
140+
{
141+
update_current.run(world, resources);
142+
}
143+
141144
break;
142145
}
143146
}

0 commit comments

Comments
 (0)