Skip to content

Commit

Permalink
Fix panic in build-scan without arguments (#1130)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi authored Feb 18, 2024
1 parent 40b1646 commit 0ba95cf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugins/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ import (
// Any empty configuration could be later overridden by environment variables if set.
func CreateBuildConfiguration(c *components.Context) *build.BuildConfiguration {
buildConfiguration := new(build.BuildConfiguration)
buildNameArg, buildNumberArg := c.Arguments[0], c.Arguments[1]
if buildNameArg == "" || buildNumberArg == "" {
buildNameArg = ""
buildNumberArg = ""
var buildNameArg, buildNumberArg string
if len(c.Arguments) > 1 && c.Arguments[0] != "" && c.Arguments[1] != "" {
buildNameArg, buildNumberArg = c.Arguments[0], c.Arguments[1]
}
buildConfiguration.SetBuildName(buildNameArg).SetBuildNumber(buildNumberArg).SetProject(c.GetStringFlagValue("project")).SetModule(c.GetStringFlagValue("module"))
return buildConfiguration
Expand Down

0 comments on commit 0ba95cf

Please sign in to comment.