Check for resource['format'] is None rather than is not None