Skip to content

Commit

Permalink
Quit if there are no jobs to display
Browse files Browse the repository at this point in the history
If there are no jobs found, then it doesn't make sense to continue. This
commit adds a check for no jobs, and terminates the program if so.
  • Loading branch information
grisu48 committed Apr 4, 2024
1 parent b871897 commit 3d97424
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/openqa-revtui/openqa-revtui.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,10 @@ func tui_main(tui *TUI, instance *gopenqa.Instance) error {
if err != nil {
return fmt.Errorf("error fetching jobs: %s", err)
}
if len(jobs) == 0 {
// No reason to continue - there are no jobs to scan
return fmt.Errorf("no jobs found")
}
// Failed jobs will be also scanned for comments
for _, job := range jobs {
state := job.JobState()
Expand Down

0 comments on commit 3d97424

Please sign in to comment.