Skip to content

Commit

Permalink
fix: resolve index out of range if no releases exist
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Jul 16, 2024
1 parent fadffa2 commit 3a42af0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,15 @@ func pullRequestFromQL(pullRequest qlPullRequest) PullRequest {
}

func releaseFromQL(release qlRelease) Release {
return Release{
Name: string(release.Nodes[0].Name),
TagName: string(release.Nodes[0].TagName),
PublishedAt: release.Nodes[0].PublishedAt.Time,
URL: string(release.Nodes[0].URL),
if len(release.Nodes) != 0 {
return Release{
Name: string(release.Nodes[0].Name),
TagName: string(release.Nodes[0].TagName),
PublishedAt: release.Nodes[0].PublishedAt.Time,
URL: string(release.Nodes[0].URL),
}
}
return Release{}
}

func repoFromQL(repo qlRepository) Repo {
Expand Down

0 comments on commit 3a42af0

Please sign in to comment.