Skip to content

Commit

Permalink
check if mpLibraryTreeItem is not NULL as it can be when re-simulating (
Browse files Browse the repository at this point in the history
#8370)

- fix #8369
  • Loading branch information
adrpo committed Dec 28, 2021
1 parent 2816063 commit 4c87b75
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion OMEdit/OMEditLIB/Simulation/SimulationDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,11 @@ bool SimulationDialog::translateModel(QString simulationParameters)
*/
SimulationOptions SimulationDialog::createSimulationOptions()
{
SimulationOptions simulationOptions = mpLibraryTreeItem->mSimulationOptions;
SimulationOptions simulationOptions;
if (mpLibraryTreeItem != NULL) {
// this can be NULL when we resimulate from the Plotting view and it would crash!
simulationOptions = mpLibraryTreeItem->mSimulationOptions;
}
simulationOptions.setClassName(mClassName);
simulationOptions.setStartTime(mpStartTimeTextBox->text());
simulationOptions.setStopTime(mpStopTimeTextBox->text());
Expand Down

0 comments on commit 4c87b75

Please sign in to comment.