# Embedded Function in Template Causes NPE

**URL:** <https://forum.inductiveautomation.com/t/embedded-function-in-template-causes-npe/4321>\
**Category:** Ignition\
**Created:** [April 19, 2012, 7:55pm UTC](https://forum.inductiveautomation.com/t/embedded-function-in-template-causes-npe/4321 "2012-04-19T19:55:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pphillips](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@pphillips](https://forum.inductiveautomation.com/u/pphillips)\
**Post date:** [April 19, 2012, 7:55pm UTC](https://forum.inductiveautomation.com/t/embedded-function-in-template-causes-npe/4321/1 "2012-04-19T19:55:19Z")

</div>

Not sure if this was covered in one of the fixes on 7.4.2, but on 7.4.1 I’ve found that a function embedded in a string concatenation in the Expression Editor for a template binding throws an NPE. This doesn’t seem to occur on non-template items.

Example for a “Text” property binding on a label:  
trim(trim({TTPack.TU\_Tbl::THK}) + "mm " + {TTPack.TU\_Tbl::COLOR} + " " + {TTPack.TU\_Tbl::COAT})

The embedded trim() function causes the error.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [May 16, 2012, 4:57pm UTC](https://forum.inductiveautomation.com/t/embedded-function-in-template-causes-npe/4321/2 "2012-05-16T16:57:49Z")

</div>

I’ve changed trim() to handle nulls more gracefully
