Skip to content

Commit 8aba54d

Browse files
committed
added validation to make sure that rowValue is a string
1 parent 9b28e30 commit 8aba54d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/utils/table.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,14 @@ export const initColumns = (columns: Column[], disableRichColumnHeaders?: boolea
255255
case ColumnFormat.EMAIL:
256256
c.cell = (row: any) => {
257257
const rowValue = getRowValueFromSelectorString(c.selector, row);
258-
const firstAuthor =
259-
//typeof rowValue === 'string' && rowValue.includes(',') ? rowValue.split(',')[0] : '';
260-
typeof rowValue === 'string' && rowValue.includes(',')
261-
? rowValue.split(',')[0]
262-
: rowValue;
258+
if (typeof rowValue === 'string') {
259+
const firstAuthor =
260+
typeof rowValue === 'string' && rowValue.includes(',')
261+
? rowValue.split(',')[0]
262+
: rowValue;
263+
} else {
264+
const firstAuthor = '';
265+
}
263266
let emailAddressPart = '';
264267
if (c && c.formatOptions && typeof row[c.formatOptions.emailAddressKey] === 'string') {
265268
const parts = row[c.formatOptions.emailAddressKey].split(':');

0 commit comments

Comments
 (0)