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

@@ -64,3 +64,10 @@ func TextMethodToModel(method object_pb.TextQueryMethod) domain.SearchMethod {
return -1
}
}
func ListQueryToModel(query *object_pb.ListQuery) (offset, limit uint64, asc bool) {
if query == nil {
return
}
return query.Offset, uint64(query.Limit), query.Asc
}