Skip to content

Commit

Permalink
account for empty versions_in_collection
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed May 27, 2024
1 parent b4b7047 commit f3ab347
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bioimageio_collection_backoffice/remote_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,10 @@ def generate_collection_json(
error_in_published_entry = f"failed to create {rc.id} entry: {e}"
logger.error(error_in_published_entry)
else:
n_resources[versions_in_collection[0].type] += 1
n_resource_versions[versions_in_collection[0].type] += len(versions)
entries.extend(versions_in_collection)
if versions_in_collection:
n_resources[versions_in_collection[0].type] += 1
n_resource_versions[versions_in_collection[0].type] += len(versions)
entries.extend(versions_in_collection)

collection = CollectionJson(
authors=(template := self.config.collection_template).authors,
Expand Down

0 comments on commit f3ab347

Please sign in to comment.