From 6d2721c8889e8aac278c60f5f93b7b1ca6d31864 Mon Sep 17 00:00:00 2001 From: vicky-primathon <67091118+vicky-primathon@users.noreply.github.com> Date: Fri, 28 Aug 2020 14:42:17 +0530 Subject: [PATCH] Fix: Table crash when calling toString on null values for sorting (#455) --- .../components/designSystems/appsmith/TableUtilities.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/client/src/components/designSystems/appsmith/TableUtilities.tsx b/app/client/src/components/designSystems/appsmith/TableUtilities.tsx index 3eedf66bb9..de3777e0c6 100644 --- a/app/client/src/components/designSystems/appsmith/TableUtilities.tsx +++ b/app/client/src/components/designSystems/appsmith/TableUtilities.tsx @@ -718,7 +718,12 @@ export function sortTableFunction( )?.metaProperties?.type || ColumnTypes.TEXT; return tableData.sort( (a: { [key: string]: any }, b: { [key: string]: any }) => { - if (a[sortedColumn] !== undefined && b[sortedColumn] !== undefined) { + if ( + a[sortedColumn] !== undefined && + a[sortedColumn] !== null && + b[sortedColumn] !== undefined && + b[sortedColumn] !== null + ) { switch (columnType) { case ColumnTypes.CURRENCY: case ColumnTypes.NUMBER: