Skip to content

Commit 4151e01

Browse files
committed
fix: add nil check
1 parent 5c827e4 commit 4151e01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/readmevalidation/coderResources.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ func validateCoderResourceIconURL(iconURL string) []error {
8989
}
9090

9191
func validateCoderResourceTags(tags []string) error {
92+
if tags == nil {
93+
return errors.New("provided tags array is nil")
94+
}
9295
if len(tags) == 0 {
9396
return nil
9497
}
@@ -140,9 +143,8 @@ func validateCoderResourceReadmeBody(body string) []error {
140143
if lineNum == 1 {
141144
if !strings.HasPrefix(nextLine, "# ") {
142145
break
143-
} else {
144-
continue
145146
}
147+
continue
146148
}
147149

148150
if strings.HasPrefix(nextLine, "```") {

0 commit comments

Comments
 (0)