Template Internal Property with Expression

Hello all,

I’m using a template with an internal property based on some passed in opc tags.
When I update the project some of the templates will show bad expressions:

Once I physically toggle the sensor tied to the template the bad expression overlay goes away.
The expression I’m using is:

How can I stop this bad expression overlay from showing up?

Thank you!

wrap your expression in the try expression: https://docs.inductiveautomation.com/display/DOC80/try

    if({1 PickBox.PtL::Sensor},if({1 PickBox.PtL::Light},1,2),0),
    0 // Default if there are errors in either of the two if statements

This worked. Thank you!