Handled null TemplateHelper in WriteTo

The method Write(TemplateWriter helper) checks that the helper parameter
is not null.
Copied this check to WriteTo(TextWriter writer, TemplateWriter helper)
The missing check caused a null reference exception in case of
Model.Collection[0].Property == null