Make sure sshkey is not nil

This commit is contained in:
wizurijyq 2018-12-14 22:30:26 +01:00 committed by GitHub
parent 74abd80c4f
commit 8184fcb99a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -43,6 +43,10 @@ func (s *stepCreateServer) Run(ctx context.Context, state multistep.StateBag) mu
state.Put("error", fmt.Errorf("Error fetching SSH key: %s", err)) state.Put("error", fmt.Errorf("Error fetching SSH key: %s", err))
return multistep.ActionHalt return multistep.ActionHalt
} }
if sshKey == nil {
state.Put("error", fmt.Errorf("Could not find key: %s", k))
return multistep.ActionHalt
}
sshKeys = append(sshKeys, sshKey) sshKeys = append(sshKeys, sshKey)
} }