From 0ccc80127ae2a11399d1e567926c1dded44aaaaf Mon Sep 17 00:00:00 2001 From: Piyush Mishra Date: Wed, 16 Dec 2020 14:52:34 +0530 Subject: [PATCH] move null check out (#2221) --- .../designSystems/appsmith/TableUtilities.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/client/src/components/designSystems/appsmith/TableUtilities.tsx b/app/client/src/components/designSystems/appsmith/TableUtilities.tsx index dc465f12b4..355556d462 100644 --- a/app/client/src/components/designSystems/appsmith/TableUtilities.tsx +++ b/app/client/src/components/designSystems/appsmith/TableUtilities.tsx @@ -464,11 +464,12 @@ export const renderCell = ( columnType: string, isHidden: boolean, ) => { + if (!value) { + return ; + } switch (columnType) { case ColumnTypes.IMAGE: - if (!value) { - return ; - } else if (!isString(value)) { + if (!isString(value)) { return (
Invalid Image
@@ -505,9 +506,7 @@ export const renderCell = ( ); case ColumnTypes.VIDEO: const youtubeRegex = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=|\?v=)([^#&?]*).*/; - if (!value) { - return ; - } else if (isString(value) && youtubeRegex.test(value)) { + if (isString(value) && youtubeRegex.test(value)) { return (