diff --git a/app/controllers/web/my-account/retrieve-aliases.js b/app/controllers/web/my-account/retrieve-aliases.js index 4b73b404c1..fbfcb34e3c 100644 --- a/app/controllers/web/my-account/retrieve-aliases.js +++ b/app/controllers/web/my-account/retrieve-aliases.js @@ -162,7 +162,7 @@ async function retrieveAliases(ctx, next) { ? // eslint-disable-next-line unicorn/no-array-callback-reference Aliases.find(query) .limit(ctx.query.limit) - .skip(ctx.paginate.skip) + .skip(ctx?.paginate?.skip) .sort(isSANB(ctx.query.sort) ? ctx.query.sort : 'created_at') .populate( 'user', @@ -202,7 +202,7 @@ async function retrieveAliases(ctx, next) { // eslint-disable-next-line unicorn/no-array-callback-reference Aliases.find(query) .limit(ctx.query.limit) - .skip(ctx.paginate.skip) + .skip(ctx?.paginate?.skip) .sort(isSANB(ctx.query.sort) ? ctx.query.sort : 'name') .populate( 'user',