mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): avoid panic when change-owner missing domain_id (#19472)
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/gotypes"
|
||||
"yunion.io/x/pkg/utils"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
@@ -125,6 +126,9 @@ func (model *SDomainLevelResourceBase) PerformChangeOwner(ctx context.Context, u
|
||||
if err != nil {
|
||||
return nil, httperrors.NewGeneralError(err)
|
||||
}
|
||||
if gotypes.IsNil(ownerId) {
|
||||
return nil, httperrors.NewMissingParameterError("domain_id")
|
||||
}
|
||||
if len(ownerId.GetProjectDomainId()) == 0 {
|
||||
return nil, httperrors.NewInputParameterError("missing new domain")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user