Skip to content

Commit 3d158a7

Browse files
authored
Merge pull request #707 from KwonIan/email_format_fix
checked for empty rowValue as well
2 parents cd634d7 + 5b0f9c1 commit 3d158a7

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/utils/table.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,15 +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-
let firstAuthor: string;
259-
if (typeof rowValue === 'string') {
260-
firstAuthor =
261-
typeof rowValue === 'string' && rowValue.includes(',')
258+
const firstAuthor =
259+
typeof rowValue === 'string'
260+
? rowValue.includes(',')
262261
? rowValue.split(',')[0]
263-
: rowValue;
264-
} else {
265-
firstAuthor = '';
266-
}
262+
: rowValue
263+
: '';
267264
let emailAddressPart = '';
268265
if (c && c.formatOptions && typeof row[c.formatOptions.emailAddressKey] === 'string') {
269266
const parts = row[c.formatOptions.emailAddressKey].split(':');

0 commit comments

Comments
 (0)