From eca058b6ad4cbec1b2cf927bedb9975ed887d740 Mon Sep 17 00:00:00 2001 From: boutinb Date: Mon, 27 Nov 2023 14:15:51 +0100 Subject: [PATCH] Check valid computed column from old JASP file Fixes https://github.com/jasp-stats/jasp-issues/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. --- CommonData/dataset.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CommonData/dataset.cpp b/CommonData/dataset.cpp index 24f1db7c0e..e9d86c9d79 100644 --- a/CommonData/dataset.cpp +++ b/CommonData/dataset.cpp @@ -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);