Fix possible NPE in RegionState
This commit is contained in:
@@ -110,7 +110,9 @@ public class RegionState<S, E> extends AbstractState<S, E> {
|
||||
@Override
|
||||
public void exit(StateContext<S, E> context) {
|
||||
for (Region<S, E> region : getRegions()) {
|
||||
region.getState().exit(context);
|
||||
if (region.getState() != null) {
|
||||
region.getState().exit(context);
|
||||
}
|
||||
region.stop();
|
||||
}
|
||||
Collection<? extends Action<S, E>> actions = getExitActions();
|
||||
|
||||
@@ -80,8 +80,7 @@ public class EndStateTests extends AbstractStateMachineTests {
|
||||
assertThat(machine.getState().getIds(), contains(TestStates3.READY));
|
||||
}
|
||||
|
||||
// disable for now, fix in other ticket
|
||||
//@Test
|
||||
@Test
|
||||
public void testEndStatesWithRegionsDefinedInStates() throws InterruptedException {
|
||||
context.register(Config3.class);
|
||||
context.refresh();
|
||||
|
||||
Reference in New Issue
Block a user