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

@@ -52,7 +52,8 @@ func (s *Server) ListUsers(ctx context.Context, req *mgmt_pb.ListUsersRequest) (
}
func (s *Server) ListUserChanges(ctx context.Context, req *mgmt_pb.ListUserChangesRequest) (*mgmt_pb.ListUserChangesResponse, error) {
res, err := s.user.UserChanges(ctx, req.UserId, req.Query.Offset, uint64(req.Query.Limit), req.Query.Asc)
offset, limit, asc := object.ListQueryToModel(req.Query)
res, err := s.user.UserChanges(ctx, req.UserId, offset, limit, asc)
if err != nil {
return nil, err
}