Skip to content

Commit

Permalink
fix(formatter): make sure object exist before getting property
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Apr 10, 2018
1 parent 24a061e commit 4961cab
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export const complexObjectFormatter: Formatter = (row: number, cell: number, val
return '';
}
const complexField = columnDef.field || '';
return complexField.split('.').reduce((obj, i) => obj[i], dataContext);
return complexField.split('.').reduce((obj, i) => (obj ? obj[i] : ''), dataContext);
};

0 comments on commit 4961cab

Please sign in to comment.