Skip to content

Commit

Permalink
Fixed #668 - DataTable: hide column after reordering columns throws e…
Browse files Browse the repository at this point in the history
…xception
  • Loading branch information
cagataycivici committed Jan 9, 2019
1 parent 9cd4766 commit 27af3ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,10 @@ export class DataTable extends Component {
if(this.props.reorderableColumns && this.state.columnOrder) {
let orderedColumns = [];
for(let columnKey of this.state.columnOrder) {
orderedColumns.push(this.findColumnByKey(columns, columnKey));
let column = this.findColumnByKey(columns, columnKey);
if (column) {
orderedColumns.push(column);
}
}

return orderedColumns;
Expand Down

0 comments on commit 27af3ed

Please sign in to comment.