Skip to content

Commit b766ef6

Browse files
committed
minor fix
1 parent a0de0e4 commit b766ef6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/pipeline/repository/PipelineStageRepository.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package repository
1818

1919
import (
20+
"github.com/devtron-labs/devtron/internal/util"
2021
"github.com/devtron-labs/devtron/pkg/plugin/repository"
2122
"github.com/devtron-labs/devtron/pkg/sql"
2223
"github.com/go-pg/pg"
@@ -907,9 +908,11 @@ func (impl *PipelineStageRepositoryImpl) CheckIfPluginExistsInPipelineStage(pipe
907908
query.Where("ps.cd_pipeline_id= ?", pipelineId)
908909
}
909910
err := query.Select()
910-
if err != nil {
911+
if err != nil && !util.IsErrNoRows(err) {
911912
impl.logger.Errorw("error in getting plugin stage step by pipelineId, stageType nad plugin id", "pipelineId", pipelineId, "stageType", stageType.ToString(), "pluginId", pluginId, "err", err)
912913
return false, err
914+
} else if util.IsErrNoRows(err) {
915+
return false, nil
913916
}
914917
return step.Id != 0, nil
915918
}

0 commit comments

Comments
 (0)