Simulator crashes when a StateMachine has no initial state
Description
If a circuit contains a StateMachine element with no defined initial
state, starting the simulator results in a NullPointerException.
This occurs because currentState is null when
StateMachine.initSim() attempts to call
currentState.sendOutputs(...).
Instead of reporting a user-facing error, the simulator crashes and
generates a bug report dialog.
Steps to Reproduce
- Create a new circuit.
- Add a
StateMachine element.
- Do not add any states (or remove all states).
- Start the interactive simulator.
Expected Behavior
The simulator should display a clear error message indicating that the
state machine has no initial state and prevent the simulation from
starting.
Actual Behavior
The simulator crashes with a NullPointerException.
Simulator crashes when a
StateMachinehas no initial stateDescription
If a circuit contains a
StateMachineelement with no defined initialstate, starting the simulator results in a
NullPointerException.This occurs because
currentStateisnullwhenStateMachine.initSim()attempts to callcurrentState.sendOutputs(...).Instead of reporting a user-facing error, the simulator crashes and
generates a bug report dialog.
Steps to Reproduce
StateMachineelement.Expected Behavior
The simulator should display a clear error message indicating that the
state machine has no initial state and prevent the simulation from
starting.
Actual Behavior
The simulator crashes with a
NullPointerException.