- check dictionary keys before using them, prevents KeyError being raised
if json is None:
print("WARNING: Could not fetch nodeinfo from blocker:", blocker)
continue
+ elif not "metadata" in json:
+ print(f"WARNING: json()={len(json)} does not have key 'metadata', blocker='{blocker}'")
+ continue
+ elif not "federation" in json["metadata"]:
+ print(f"WARNING: json()={len(json['metadata'])} does not have key 'federation', blocker='{blocker}'")
+ continue
# DEBUG: print("DEBUG: Updating nodeinfo:", blocker)
fba.update_last_nodeinfo(blocker)