Skip to content

Commit

Permalink
Handle empty list Glue Job Runs / Crawlers
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcmessias committed Nov 7, 2022
1 parent 1d78ecf commit d0d3677
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions data/glue.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func (c *GlueClient) GetJobsRows(nextToken *string) ([]table.Row, *string, error
log.Fatalf("unable to get Glue jobs: %v", err)
}

if len(listOutput.JobNames) == 0 {
return nil, nil, nil
}

getInput := glue.BatchGetJobsInput{
JobNames: listOutput.JobNames,
}
Expand Down Expand Up @@ -68,6 +72,10 @@ func (c *GlueClient) GetCrawlersRows(nextToken *string) ([]table.Row, *string, e
log.Fatalf("unable to get Glue jobs: %v", err)
}

if len(listOutput.CrawlerNames) == 0 {
return nil, nil, nil
}

getInput := glue.BatchGetCrawlersInput{
CrawlerNames: listOutput.CrawlerNames,
}
Expand Down

0 comments on commit d0d3677

Please sign in to comment.