From 076608d26328ff6487a32f62933807d359dbc8ef Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 10 Nov 2023 13:42:31 +0530 Subject: [PATCH] fix: handle if sorts is undefined/null --- packages/nocodb/src/db/BaseModelSqlv2.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 58a987dc89..8d07e71682 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -667,7 +667,7 @@ class BaseModelSqlv2 { // if sort is provided filter out the group by columns sort and apply // since we are grouping by the column and applying sort on any other column is not required - for (const sort of sorts) { + for (const sort of sorts || []) { if (!groupByColumns[sort.fk_column_id]) { continue; }