Skip to content

Commit

Permalink
skip package and version validtion on empty value (#1588)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Spacca authored Dec 8, 2023
1 parent 4ee76e2 commit a5c8a8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ func rallyCommandAction(cmd *cobra.Command, args []string) error {
}

func getPackageNameAndVersion(packageFromRegistry string) (string, string, error) {
if len(packageFromRegistry) == 0 {
return "", "", nil
}

name, version, valid := strings.Cut(packageFromRegistry, "-")
if !valid || name == "" || version == "" {
return "", "", fmt.Errorf("package name and version from registry not valid (%s)", packageFromRegistry)
Expand Down

0 comments on commit a5c8a8e

Please sign in to comment.