mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix(region): check whether ipProvider is nil
This commit is contained in:
@@ -1654,10 +1654,12 @@ func (manager *SGuestManager) validateEip(userCred mcclient.TokenCredential, inp
|
||||
input.Eip = eipObj.GetId()
|
||||
|
||||
eipCloudprovider := eip.GetCloudprovider()
|
||||
if len(preferManagerId) > 0 && preferManagerId != eipCloudprovider.Id {
|
||||
return httperrors.NewConflictError("cannot assoicate with eip %s: different cloudprovider", eipStr)
|
||||
if eipCloudprovider != nil {
|
||||
if len(preferManagerId) > 0 && preferManagerId != eipCloudprovider.Id {
|
||||
return httperrors.NewConflictError("cannot assoicate with eip %s: different cloudprovider", eipStr)
|
||||
}
|
||||
input.PreferManager = eipCloudprovider.Id
|
||||
}
|
||||
input.PreferManager = eipCloudprovider.Id
|
||||
|
||||
eipRegion, err := eip.GetRegion()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user