#30: added a check when a entity can be null like on the preview of a template