Skip to content

EspoCRM – Open Source CRM Application

Fix

Yurii349c0312763d
diff --git a/client/src/collection.ts b/client/src/collection.ts
index ac255e9b9f..cb80fa2c54 100644
--- a/client/src/collection.ts
+++ b/client/src/collection.ts
@@ -377,11 +377,11 @@ export default class Collection<TModel extends Model = Model> {
// Should not undefined if not set.
let at = options.at;
- if (at > this.length) {
+ if (at != null && at > this.length) {
at = this.length;
}
- if (at < 0) {
+ if (at != null && at < 0) {
at += this.length + 1;
}