diff --git a/backend/api/measure/session.go b/backend/api/measure/session.go index ea0c6e63e..99d4f4ebf 100644 --- a/backend/api/measure/session.go +++ b/backend/api/measure/session.go @@ -497,15 +497,15 @@ func GetSessionsWithFilter(ctx context.Context, af *filter.AppFilter) (sessions resultLen := len(sessions) - // handle pagination + // set pagination next & previous + // flags if resultLen > af.Limit { sessions = sessions[:resultLen-1] next = true if af.Offset >= af.Limit { previous = true } - } else if resultLen <= af.Limit { - next = false + } else if resultLen > 0 && resultLen <= af.Limit { previous = true }