Error !

AttributeError: 'NoneType' object has no attribute 'val'

% if object.val('mainimage.text'): <figcaption> <p>${object.val('mainimage.text')}</p> % if image.val('author'): ${ i18n('site-Fotograf', lang=object.language()) }: ${image.val('author')} % endif </figcaption> % elif image.val('caption'): <figcaption>
templates/imr/news-article, line 77:
% if image.val('author'):
templates/imr/site, line 63:
/var/limecms/hi/lib/python2.7/site-packages/Mako-1.0.7-py2.7.egg/mako/runtime.py, line 899:
callable_(context, *args, **kwargs)
/var/limecms/hi/lib/python2.7/site-packages/Mako-1.0.7-py2.7.egg/mako/runtime.py, line 873:
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
/var/limecms/hi/lib/python2.7/site-packages/Mako-1.0.7-py2.7.egg/mako/runtime.py, line 838:
**_kwargs_for_callable(callable_, data))
/var/limecms/hi/lib/python2.7/site-packages/Mako-1.0.7-py2.7.egg/mako/template.py, line 462:
return runtime._render(self, self.callable_, args, data)
/var/limecms/hi/hi-inst-02/Products/LimeTemplate/LimeTemplate.py, line 704:
html = mytemplate.render(object=object, site=site, request=self.REQUEST, extra=extra.get('kwargs', None), **extra)