fix: handle possible nil pointer of query (#1407)

This commit is contained in:
Livio Amstutz
2021-03-11 09:40:40 +01:00
committed by GitHub
parent 5cfb6ca0e9
commit af55c4a65c
19 changed files with 122 additions and 72 deletions

View File

@@ -1,15 +1,17 @@
package auth
import (
"github.com/caos/zitadel/internal/api/grpc/object"
"github.com/caos/zitadel/internal/usergrant/model"
auth_pb "github.com/caos/zitadel/pkg/grpc/auth"
)
func ListMyUserGrantsRequestToModel(req *auth_pb.ListMyUserGrantsRequest) *model.UserGrantSearchRequest {
offset, limit, asc := object.ListQueryToModel(req.Query)
return &model.UserGrantSearchRequest{
Offset: req.Query.Offset,
Limit: uint64(req.Query.Limit),
Asc: req.Query.Asc,
Offset: offset,
Limit: limit,
Asc: asc,
}
}