Add check for null in template file.