Skip to content

Commit 832d90d

Browse files
committed
Handle empty contacts list
Signed-off-by: Piotr Persona <persona.piotr@gmail.com>
1 parent 1e26178 commit 832d90d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

api/contacts/google_issuer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ def __init__(self, api_client: Client):
1515

1616
@staticmethod
1717
def connections_ids(response):
18-
LOG.debug(f'Connections {response["connections"]}')
19-
sources = list(map(lambda c: c["metadata"]["sources"], response["connections"]))
18+
connections = response.get("connections", [])
19+
LOG.debug(f'Connections {connections}')
20+
sources = list(map(lambda c: c["metadata"]["sources"], connections))
2021
elements = [item for sublist in sources for item in sublist]
2122
profiles = list(filter(lambda s: s["type"] == "PROFILE", elements))
2223
return list(map(lambda profile: profile["id"], profiles))

0 commit comments

Comments
 (0)