Commit 62a6356d authored by Alexander Semke's avatar Alexander Semke
Browse files

[R] properly handle the case in the variable model when there is no variable...

[R] properly handle the case in the variable model when there is no variable value for a given variable name (e.g. 'l = c()').

BUG: 450854
FIXED-IN: 22.03
parent 8b0049c8
Pipeline #142571 passed with stage
in 5 minutes and 24 seconds
......@@ -54,10 +54,15 @@ void RVariableModel::parseResult(Cantor::Expression::Status status)
QList<Variable> vars;
if (!values.isEmpty()) // Variables management disabled
for (int i = 0; i < names.size(); i++)
vars.append(Variable{names[i], values[i]});
{
if (i < values.size())
vars.append(Variable{names.at(i), values.at(i)});
else
vars.append(Variable{names.at(i), QString()});
}
else
for (int i = 0; i < names.size(); i++)
vars.append(Variable{names[i], QString()});
vars.append(Variable{names.at(i), QString()});
setVariables(vars);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment