That means that there's a templating problem in the message.tpl. Most probable subject in an extra {/IF} or {/LOOP ...} statement in the code that doesn't belong there.
You could inspect the /tmp file around the provided line number to see where the issue could be in the source template file.