mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(keystone): avoid panic
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/gotypes"
|
||||
"yunion.io/x/pkg/util/rbacscope"
|
||||
"yunion.io/x/sqlchemy"
|
||||
|
||||
@@ -189,6 +190,9 @@ func fetchItemByName(manager IModelManager, ctx context.Context, userCred mcclie
|
||||
return nil, err
|
||||
}
|
||||
if count > 0 {
|
||||
if gotypes.IsNil(query) {
|
||||
query = jsonutils.NewDict()
|
||||
}
|
||||
ownerId, _, err, _ := FetchCheckQueryOwnerScope(ctx, userCred, query, manager, rbacutils.ActionGet, true)
|
||||
if err != nil {
|
||||
return nil, httperrors.NewGeneralError(err)
|
||||
|
||||
Reference in New Issue
Block a user