Skip to content

Commit 20d2d19

Browse files
authored
Use same expression if fail to find the variable binding expression (#9734)
1 parent 3caf7a9 commit 20d2d19

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

OMEdit/OMEditLIB/Annotations/DynamicAnnotation.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ void DynamicAnnotation::evaluate(ModelInstance::Model *pModel)
9393
auto vname = QString::fromStdString(name);
9494
// the instance api returns the qualified cref
9595
vname = StringHandler::getLastWordAfterDot(vname);
96-
return pModel->getVariableBinding(vname);
96+
FlatModelica::Expression exp = pModel->getVariableBinding(vname);
97+
if (exp.isNull()) {
98+
return mExp;
99+
} else {
100+
return exp;
101+
}
97102
}));
98103
} catch (const std::exception &e) {
99104
qDebug() << "Failed to evaluate expression.";

0 commit comments

Comments
 (0)