Skip to content

Commit

Permalink
fix error check in networktype shim
Browse files Browse the repository at this point in the history
  • Loading branch information
ctreatma committed Sep 29, 2023
1 parent ce9af22 commit 19abaa2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions equinix/helpers_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ func getNetworkInfo(ips []*packngo.IPAddressAssignment) NetworkInfo {
}

func getNetworkTypeMetalGo(device *metalv1.Device) (*string, error) {

pgDevice := packngo.Device{}
res, err := device.MarshalJSON()
if err != nil {
json.Unmarshal(res, pgDevice)
networkType := pgDevice.GetNetworkType()
return &networkType, nil
if err == nil {
if err = json.Unmarshal(res, &pgDevice); err == nil {
networkType := pgDevice.GetNetworkType()
return &networkType, nil
}
}
return nil, err
}
Expand Down

0 comments on commit 19abaa2

Please sign in to comment.