Skip to content

Commit 334550b

Browse files
authored
Check error before assigning api (#776)
1 parent fbf8f22 commit 334550b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/operator/endpoints/deploy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ func Deploy(w http.ResponseWriter, r *http.Request) {
8989
results := make([]schema.DeployResult, len(apiConfigs))
9090
for i, apiConfig := range apiConfigs {
9191
api, msg, err := operator.UpdateAPI(&apiConfig, projectID, force)
92-
results[i].API = *api
9392
results[i].Message = msg
9493
if err != nil {
9594
results[i].Error = errors.Message(err)
95+
} else {
96+
results[i].API = *api
9697
}
9798
}
9899

0 commit comments

Comments
 (0)