Skip to content

Commit

Permalink
If new coloum set is shorter than previous default sorted column, the…
Browse files Browse the repository at this point in the history
… project crashes (#492)
  • Loading branch information
zachrickards authored Feb 26, 2022
1 parent 3aa7790 commit 031a933
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/material-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default class MaterialTable extends React.Component {
(a) => a.defaultSort && a.sorting !== false
);
prevSortDirection =
prevSortColumnIndex > -1
prevSortColumnIndex > -1 && props.columns[prevSortColumnIndex]
? props.columns[prevSortColumnIndex].defaultSort
: '';
}
Expand Down

0 comments on commit 031a933

Please sign in to comment.