diff --git a/server/szurubooru/search/executor.py b/server/szurubooru/search/executor.py index 7f55fce..a4b0d44 100644 --- a/server/szurubooru/search/executor.py +++ b/server/szurubooru/search/executor.py @@ -81,7 +81,7 @@ class Executor(object): filter_query = filter_query.options(sqlalchemy.orm.lazyload('*')) filter_query = self._prepare_db_query(filter_query, search_query, True) entities = filter_query \ - .offset((page - 1) * page_size) \ + .offset(max(page - 1, 0) * page_size) \ .limit(page_size) \ .all()