Improve stability when there is no fields

This commit is contained in:
Thibault Cohen 2023-01-19 20:57:06 -05:00
parent 48bc422974
commit f4d05fdd0f

View File

@ -31,6 +31,8 @@ def parse_login_scope(secret_json, key):
return secret_json["login"][key]
def parse_fields_scope(secret_json, key):
if "fields" not in secret_json:
return None
for entry in secret_json["fields"]:
if entry['name'] == key:
return entry['value']