Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

count === 0 must add a limit clause

Chocobozzz28a7046464ec
diff --git a/server/core/models/shared/abstract-run-query.ts b/server/core/models/shared/abstract-run-query.ts
index 94eca80709..b731f53872 100644
--- a/server/core/models/shared/abstract-run-query.ts
+++ b/server/core/models/shared/abstract-run-query.ts
@@ -1,6 +1,7 @@
import { QueryTypes, Sequelize, Transaction } from 'sequelize'
import { getSort, throwOnInvalidSortColumnName } from './sort.js'
import { Col } from 'sequelize/lib/utils'
+import { exists } from '@peertube/peertube-core-utils'
/**
* Abstract builder to run video SQL queries
@@ -76,7 +77,7 @@ export class AbstractRunQuery {
// ---------------------------------------------------------------------------
protected getLimit (start: number, count: number) {
- if (!count) return ''
+ if (!exists(count)) return ''
this.replacements.limit = count
this.replacements.offset = start || 0