Skip to content

Commit 72535cd

Browse files
committed
change foundPipeline to a pointer
1 parent d6ef7e3 commit 72535cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

handlers/pipeline.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,23 @@ func PipelineDelete(c echo.Context) error {
147147
}
148148

149149
// Look up pipeline for the given id
150-
var foundPipeline gaia.Pipeline
150+
var foundPipeline *gaia.Pipeline
151151
var index int
152152
var deletedPipelineIndex int
153153
for pipeline := range pipeline.GlobalActivePipelines.Iter() {
154154
if pipeline.ID == pipelineID {
155-
foundPipeline = pipeline
155+
foundPipeline = &pipeline
156156
deletedPipelineIndex = index
157157
}
158158
index++
159159
}
160160

161-
if foundPipeline.Name == "" {
161+
if foundPipeline == nil {
162162
return c.String(http.StatusNotFound, err.Error())
163163
}
164164

165165
// Delete pipeline binary
166-
err = pipeline.DeleteBinary(foundPipeline)
166+
err = pipeline.DeleteBinary(*foundPipeline)
167167
if err != nil {
168168
return c.String(http.StatusInternalServerError, err.Error())
169169
}

0 commit comments

Comments
 (0)