Skip to content

Commit

Permalink
Merge pull request #155 from ebfe/wait-panic
Browse files Browse the repository at this point in the history
Fix nil pointer dereference
  • Loading branch information
moul committed Sep 3, 2015
2 parents 4c31f02 + d23e593 commit fd8910b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/api/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,13 @@ func WaitForServerState(api *ScalewayAPI, serverID string, targetState string) (

for {
server, err = api.GetServer(serverID)
if err != nil {
return nil, err
}
if currentState != server.State {
log.Infof("Server changed state to '%s'", server.State)
currentState = server.State
}
if err != nil {
return nil, err
}
if server.State == targetState {
break
}
Expand Down

0 comments on commit fd8910b

Please sign in to comment.