Skip to content

Commit

Permalink
fix: ensure version parts have enough elements not to panic
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Jan 6, 2022
1 parent 58ef73d commit 953f0b3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manifest/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ func ParseVersion(version string) Version {
if parts[3] != "" {
prerelease = versionPartsRe.Split(parts[3], -1)
}
for len(parts) < 6 {
parts = append(parts, "")
}
metadata = parts[5]
return Version{
orig: parts[1:],
Expand Down

0 comments on commit 953f0b3

Please # to comment.