Skip to content

Commit

Permalink
Check valid computed column from old JASP file
Browse files Browse the repository at this point in the history
Fixes jasp-stats/jasp-issues#2428

Apparently in the JASP file of the issue, a computed column was made that made the engine crash. This computed column is still written in the metadata.json, but it is ignored in 0.17.3. When upgrading to 0.18.1, this computed column is added and makes the engine crash. So just ignore this computed column when upgrading.
  • Loading branch information
boutinb committed Nov 27, 2023
1 parent 476cf7b commit eca058b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CommonData/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,13 @@ const Columns & DataSet::computedColumns() const

void DataSet::loadOldComputedColumnsJson(const Json::Value &json)
{
if (!json.isArray()) return;

for(const Json::Value & colJson : json)
{
Log::log() << "Old computed column: " << colJson.toStyledString() << std::endl;
if (!colJson.isObject() || colJson["error"].asString().rfind("The engine crashed", 0) == 0) continue;

const std::string name = colJson["name"].asString();

Column * col = column(name);
Expand Down

0 comments on commit eca058b

Please sign in to comment.