Skip to content

Commit e0fefbe

Browse files
Merge pull request #18 from replicatedhq/diamonwiggins/fix-nil-pointer-error
Check for errors before accessing notes to prevent nil pointer
2 parents 9a95488 + 33dfade commit e0fefbe

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,15 @@ func main() {
109109
}
110110

111111
notes, err := getAllReleaseNotes(ctx, client, owner, repo, base, head, includePrLinks, typeLabelFlags)
112+
if err != nil {
113+
log.Fatalf("Failed to get release notes: %v", err)
114+
}
112115

113116
// if the release notes do not contain any features, improvements, or bugs, do not submit release notes
114117
if len(notes.Features) == 0 && len(notes.Improvements) == 0 && len(notes.Bugs) == 0 {
115118
return
116119
}
117120

118-
if err != nil {
119-
log.Fatalf("Failed to get release notes: %v", err)
120-
}
121-
122121
notes.Title = title
123122
notes.TitleDash = strings.ReplaceAll(notes.Title, ".", "-")
124123
notes.DateString = time.Now().Format("January 2, 2006")

0 commit comments

Comments
 (0)