diff --git a/pkg/cloudcommon/db/domainresource.go b/pkg/cloudcommon/db/domainresource.go index 944554c87c..c59bd4b175 100644 --- a/pkg/cloudcommon/db/domainresource.go +++ b/pkg/cloudcommon/db/domainresource.go @@ -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") }