Skip to content

Commit

Permalink
A computed column is not always computed when opening a JASP file
Browse files Browse the repository at this point in the history
Make a JASP file with several analyses.
Add a computed column by using another column.
Save it, close it, and open it again: the computed column is not computed due to an engine crash.

This crash is due to the fact that when trying to compute the computed column, the ColumnEncoder in the Engine was not yet initilalized with the names of the columns.
  • Loading branch information
boutinb committed Jan 9, 2024
1 parent 9f2ded3 commit c148f77
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Engine/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,18 @@ DataSet * Engine::provideAndUpdateDataSet()

Log::log(false) << std::endl;
}
else if(_db->dataSetGetId() != -1) _dataSet = new DataSet(_db->dataSetGetId());
else
{
Log::log() << "No dataset, ";
if(_db->dataSetGetId() != -1)
{
Log::log() << "create a new dataset" << std::endl;
_dataSet = new DataSet(_db->dataSetGetId());
ColumnEncoder::columnEncoder()->setCurrentNames(_dataSet->getColumnNames());
}
else
Log::log() << "No database" << std::endl;
}

JASPTIMER_STOP(Engine::provideDataSet());

Expand Down

0 comments on commit c148f77

Please sign in to comment.