Skip to content

Commit

Permalink
Fix panic if "DecodeServerIDFromProviderID" returns an error
Browse files Browse the repository at this point in the history
  • Loading branch information
NotTheEvilOne committed Jun 13, 2022
1 parent 31e984d commit 92ef120
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/hcloud/machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func (p *MachineProvider) GetMachineStatus(ctx context.Context, req *driver.GetM
serverID = server.ID
} else {
serverID, err := transcoder.DecodeServerIDFromProviderID(machine.Spec.ProviderID)
if err == nil {
if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
}

Expand Down

0 comments on commit 92ef120

Please sign in to comment.