Skip to content

Commit d8731f7

Browse files
authored
fix: skip null collaborator entries in GraphQL response (#246)
Signed-off-by: Cornelius Schumacher <cornelius.schumacher@deutschebahn.com>
1 parent ad5ce4f commit d8731f7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

gh_org_mgr/_gh_org.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,13 @@ def _populate_current_repos_collaborators(self) -> None:
12431243
if repo.name in self.graphql_repos_collaborators:
12441244
# Extract each collaborator from the GraphQL response for this repo
12451245
for collaborator in self.graphql_repos_collaborators[repo.name]:
1246+
if collaborator is None or collaborator.get("node") is None:
1247+
logging.debug(
1248+
"Skipping collaborator entry with missing data in repo %s: %s",
1249+
repo.name,
1250+
collaborator,
1251+
)
1252+
continue
12461253
login: str = collaborator["node"]["login"]
12471254
# Skip entry if collaborator is org owner, which is "admin" anyway
12481255
if login.lower() in [user.login.lower() for user in self.current_org_owners]:

0 commit comments

Comments
 (0)