From bfb6091b7344e6e62be51e7e2441297c4a97058f Mon Sep 17 00:00:00 2001 From: Strahinja Jacimovic Date: Sun, 21 Jul 2024 20:55:29 +0200 Subject: [PATCH] Update index.py --- scripts/index.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/index.py b/scripts/index.py index e108763da..4655a7ad7 100644 --- a/scripts/index.py +++ b/scripts/index.py @@ -151,7 +151,10 @@ def index_release_to_elasticsearch(es : Elasticsearch, index_name, release_detai } else: metadata_item = find_item_by_name(metadata_content[0], name_without_extension) - previous_metadata_item = find_item_by_name(metadata_content[1], name_without_extension) + if len(metadata_content) > 1: + previous_metadata_item = find_item_by_name(metadata_content[1], name_without_extension) + else: + previous_metadata_item = find_item_by_name(metadata_content[0], name_without_extension) if metadata_item: if previous_metadata_item: