From f3ab347b122a11e25a9c8ce77d62bbc85544663f Mon Sep 17 00:00:00 2001 From: fynnbe Date: Mon, 27 May 2024 13:30:06 +0200 Subject: [PATCH] account for empty versions_in_collection --- bioimageio_collection_backoffice/remote_collection.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bioimageio_collection_backoffice/remote_collection.py b/bioimageio_collection_backoffice/remote_collection.py index ecf94b90..7567c2ca 100644 --- a/bioimageio_collection_backoffice/remote_collection.py +++ b/bioimageio_collection_backoffice/remote_collection.py @@ -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,