Skip to content

Commit 0004ae8

Browse files
committed
length check and empty array target platform
1 parent 6455979 commit 0004ae8

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

pkg/pipeline/adapter/adapter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@ func GetStepVariableDto(variable *repository.PipelineStageStepVariable) (*pipeli
382382

383383
func GetTargetPlatformObjectFromString(targetPlatformString string) []*pipelineConfigBean.TargetPlatform {
384384
targetPlatforms := GetTargetPlatformListFromString(targetPlatformString)
385-
var targetPlatformObject []*pipelineConfigBean.TargetPlatform
385+
targetPlatformObject := []*pipelineConfigBean.TargetPlatform{}
386386
for _, targetPlatform := range targetPlatforms {
387-
if len(targetPlatform) == 0 {
387+
if len(targetPlatform) > 0 {
388388
targetPlatformObject = append(targetPlatformObject, &pipelineConfigBean.TargetPlatform{Name: targetPlatform})
389389
}
390390
}

0 commit comments

Comments
 (0)