The new parser is a bit stricter, throwing exceptions in cases it did not use to before. In principle this is great, however it led to an issue with the default "Conditional Value" item in - in this case - a Process Flow Assign Labels activity.
We wanted to find the center object of an object, if any, otherwise assign null. So we used the Conditional option:
which produces the same code as it has always produced:
int condition = /** \nCondition: *//***tag:expression*//**/current.centerObjects.length > 0/**/; Variant value1 = /** \nIf Condition is true: *//***tag:true*//**/current.centerObjects[ 1 ]/**/; Variant value2 = /** \nIf Condition is false: *//***tag:false*//**/nullvar/**/; return condition ? value1 : value2;
Note that both alternatives are evaluated in value1 and value2, and based on the condition one of them is returned. However, this leads to the issue that even when the condition is false, we try to evaluate
current.centerObjects[ 1 ]
and we get an exception. We manually changed the code to
return /** \nCondition: *//***tag:expression*//**/current.centerObjects.length > 0/**/ ? (/** \nIf Condition is true: *//***tag:true*//**/current.centerObjects[ 1 ]/**/) : (/** \nIf Condition is false: *//***tag:false*//**/nullvar/**/);
Before this was not a problem, because even if the object did not have center connections, evaluation of
var value2 = centerobject( current, 1 );
would simply assign the "invalid-node" pointer to value2 without throwing and then return value1.
TL;DR: bug report / feature request: avoid evaluating all alternatives in Conditional activities. The same probably goes for other activities such as By Percentage.