Skip to content

Commit

Permalink
#2300: scripts: check if comm data exists
Browse files Browse the repository at this point in the history
  • Loading branch information
cz4rs authored and cwschilly committed Sep 20, 2024
1 parent f0563dd commit 4e4eaf4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/JSON_data_files_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,10 @@ def validate_comm_links(all_jsons):
task_ids = set()

for data in all_jsons:
#FIXME: KeyErorr: 'communications'
#if data... get("communications") is not None:
comms = data["phases"][n]["communications"]
comm_ids.update({int(comm["from"]["id"]) for comm in comms})
comm_ids.update({int(comm["to"]["id"]) for comm in comms})
if data["phases"][n].get("communications") is not None:
comms = data["phases"][n]["communications"]
comm_ids.update({int(comm["from"]["id"]) for comm in comms})
comm_ids.update({int(comm["to"]["id"]) for comm in comms})

tasks = data["phases"][n]["tasks"]
task_ids.update({int(task["entity"]["id"]) for task in tasks})
Expand Down

0 comments on commit 4e4eaf4

Please sign in to comment.