Skip to content

Commit 209c9b4

Browse files
committed
checked for empty rowValue as well
1 parent 8aba54d commit 209c9b4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/utils/table.tsx

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

0 commit comments

Comments
 (0)