Skip to content

Commit

Permalink
Wrong way of using references. (#5579)
Browse files Browse the repository at this point in the history
  • Loading branch information
boutinb authored Jun 20, 2024
1 parent 2b30b44 commit 7a954ed
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions QMLComponents/analysisbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ Json::Value& AnalysisBase::_getParentBoundValue(const QVector<JASPControl::Paren

if (parentBoundValue->isMember(parent.name))
{
Json::Value& parentBoundValues = (*parentBoundValue)[parent.name];
Json::Value* parentBoundValues = &(*parentBoundValue)[parent.name];
metaValue = &(*metaValue)[parent.name];
bool hasTypes = !metaValue->isNull() && metaValue->isMember("hasTypes") ? (*metaValue)["hasTypes"].asBool() : false;
if (hasTypes && parentBoundValues.isObject() && parentBoundValues.isMember("value"))
parentBoundValues = parentBoundValues["value"];
if (hasTypes && parentBoundValues->isObject() && parentBoundValues->isMember("value"))
parentBoundValues = &(*parentBoundValues)["value"];

if (!parentBoundValues.isNull() && parentBoundValues.isArray())
if (!parentBoundValues->isNull() && parentBoundValues->isArray())
{
for (Json::Value & boundValue : parentBoundValues)
for (Json::Value & boundValue : (*parentBoundValues))
{
if (boundValue.isMember(parent.key))
{
Expand Down Expand Up @@ -197,8 +197,8 @@ Json::Value& AnalysisBase::_getParentBoundValue(const QVector<JASPControl::Paren
newValue.append(parent.value[i]);
row[parent.key] = newValue;
}
parentBoundValues.append(row);
parentBoundValue = &(parentBoundValues[parentBoundValues.size() - 1]);
parentBoundValues->append(row);
parentBoundValue = &(parentBoundValues[parentBoundValues->size() - 1]);
found = true;
}
}
Expand Down

0 comments on commit 7a954ed

Please sign in to comment.