fixed null error

This commit is contained in:
polaris
2024-07-07 11:47:07 -04:00
parent c61ab3e2e7
commit df7646ddeb

View File

@ -60,8 +60,8 @@ export const columns: ColumnDef<chunithm>[] = [
}, },
cell: ({ row }) => <div>{row.original.score?.toLocaleString()}</div>, cell: ({ row }) => <div>{row.original.score?.toLocaleString()}</div>,
sortingFn: (a, b) => { sortingFn: (a, b) => {
const highScore = a.original.score; const highScore = a.original.score ?? 0;
const lowScore = b.original.score; const lowScore = b.original.score ?? 0;
if (highScore < lowScore) return 1; if (highScore < lowScore) return 1;
if (highScore > lowScore) return -1; if (highScore > lowScore) return -1;