diff --git a/artifactory/services/utils/artifactoryutils.go b/artifactory/services/utils/artifactoryutils.go index 584a8285e..dda02f4ff 100644 --- a/artifactory/services/utils/artifactoryutils.go +++ b/artifactory/services/utils/artifactoryutils.go @@ -269,6 +269,10 @@ func filterAqlSearchResultsByBuild(specFile *CommonParams, reader *content.Conte if err != nil { return nil, err } + if buildName == "" { + // If build was not found, return an empty reader to filter out all artifacts + return content.NewEmptyContentReader(content.DefaultKey), nil + } aggregatedBuilds, err := getAggregatedBuilds(buildName, buildNumber, specFile.Project, flags) if err != nil { @@ -580,7 +584,7 @@ func GetBuildInfo(buildName, buildNumber, projectKey string, flags CommonConf) ( // Build BuildInfo struct from json. publishedBuildInfo := &buildinfo.PublishedBuildInfo{} - if err := json.Unmarshal(body, publishedBuildInfo); err != nil { + if err = json.Unmarshal(body, publishedBuildInfo); err != nil { return nil, true, err } diff --git a/utils/utils.go b/utils/utils.go index eb37640dc..f577eb6e5 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -27,7 +27,7 @@ import ( const ( Development = "development" Agent = "jfrog-client-go" - Version = "1.34.0" + Version = "1.34.1" ) type MinVersionProduct string