Skip to content

Crash Caused by Stateless FSM #24

@RexPaster

Description

@RexPaster

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

  1. Create a new circuit.
  2. Add a StateMachine element.
  3. Do not add any states (or remove all states).
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions