Skip to content

Commit

Permalink
Fix SIGSEGV on update error
Browse files Browse the repository at this point in the history
  • Loading branch information
egegunes committed May 12, 2020
1 parent 62350b7 commit 0dae7eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## [0.3.1] - 2020-05-12
### Fixed
- Panic with runtime error on trying to update non existent variable or project

## [0.3.0] - 2020-05-01
### Added
- New command (`lint`) for validating .gitlab-ci.yml files
Expand Down
5 changes: 2 additions & 3 deletions cmd/env_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ var envUpdateCmd = &cobra.Command{
EnvironmentScope: &scope,
}

variable, _, err := git.ProjectVariables.UpdateVariable(pid, key, variableOptions, nil)
fmt.Fprintf(os.Stderr, "updating %s...", variable.Key)

_, _, err := git.ProjectVariables.UpdateVariable(pid, key, variableOptions, nil)
fmt.Fprintf(os.Stderr, "updating %s...", key)
if err != nil {
fmt.Fprintf(os.Stderr, "%s\n", RED("error"))
fmt.Fprintf(os.Stderr, "couldn't update variable: %v\n", err)
Expand Down

0 comments on commit 0dae7eb

Please sign in to comment.