Skip to content

Commit

Permalink
Merge pull request #64 from praetorian-inc/fix/result_error_handling
Browse files Browse the repository at this point in the history
Fix stack trace issue with GraphQL API result handling.
  • Loading branch information
jstawinski authored Apr 16, 2024
2 parents 715c0d9 + ad44230 commit e006b72
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 e006b72

Please sign in to comment.