Fixes a bug that lead to program termination if a root-after-reinitialization error (potentially also others) occurred at an output timepoint, because an non-existing/invalid SimulationState for that timepoint was accessed. See #2491 for further details.
Fixes #2491.
Also avoid some unnecessary copying (during which previously the segfault occurred if this bug triggered in non-debug builds).
Fixes a bug that lead to program termination if a root-after-reinitialization error (potentially also others) occurred at an output timepoint, because an non-existing/invalid SimulationState for that timepoint was accessed. See #2491 for further details.
Fixes #2491.
Also avoid some unnecessary copying (during which previously the segfault occurred if this bug triggered in non-debug builds).