Skip to content

Commit

Permalink
Fix stack trace issue with graphQL API result handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdnaneKhan committed Jan 15, 2024
1 parent baff978 commit b498576
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions gato/enumerate/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,18 @@ def construct_workflow_cache(self, yml_results):
(100 nodes at a time).
"""
for result in yml_results:
owner = result['nameWithOwner']
# If we get any malformed/missing data just skip it and
# Gato will fall back to the contents API for these few cases.
if not result:
continue

self.workflow_cache[owner] = list()
if 'nameWithOwner' not in result:
continue

owner = result['nameWithOwner']
# Empty means no yamls, so just skip.
if not result['object']:
self.workflow_cache[owner] = list()
continue

for yml_node in result['object']['entries']:
Expand Down

0 comments on commit b498576

Please sign in to comment.