diff --git a/scripts/add_extra_index_info.py b/scripts/add_extra_index_info.py index d9721d4d6..92b759613 100644 --- a/scripts/add_extra_index_info.py +++ b/scripts/add_extra_index_info.py @@ -256,12 +256,13 @@ def add(indexed_item_source, gh_token, es_index): else: download_database('https://github.com/MikroElektronika/core_packages/blob/main/necto_db.db?raw=true', db_path) - # Get extra info for boards - if indexed_item_source['category'] == 'Board Package': - doc_extra_info = form_extra_information('board', indexed_item_source['display_name'], indexed_item_source['download_link'], gh_token) - # Get extra info for cards - elif indexed_item_source['category'] == 'Card Package': - doc_extra_info = form_extra_information('card', indexed_item_source['display_name'], indexed_item_source['download_link'], gh_token) - if doc_extra_info != {}: - indexed_item_source.update(doc_extra_info) - print(f"INFO: Added \"extra_information\" to {indexed_item_source['name']}") \ No newline at end of file + if 'category' in indexed_item_source: + # Get extra info for boards + if indexed_item_source['category'] == 'Board Package': + doc_extra_info = form_extra_information('board', indexed_item_source['display_name'], indexed_item_source['download_link'], gh_token) + # Get extra info for cards + elif indexed_item_source['category'] == 'Card Package': + doc_extra_info = form_extra_information('card', indexed_item_source['display_name'], indexed_item_source['download_link'], gh_token) + if doc_extra_info != {}: + indexed_item_source.update(doc_extra_info) + print(f"INFO: Added \"extra_information\" to {indexed_item_source['name']}")