Error when sorting column containing a unicode character and a null value

Error when sorting column containing a unicode character and a null value

paulh736paulh736 Posts: 9Questions: 6Answers: 0

https://live.datatables.net/zoyajixa/1/

I'm getting an error when trying to sort on a column that contains one row with a null value, and one row with a unicode character (a German u with an umlaut in this case). If I give the null field a value, or replace the unicode character with a plain ASCII "u", it works fine, but if I have both, I get an error. Is that a bug, or have I missed something out?

dataTables.js:12514 Uncaught TypeError: Cannot read properties of null (reading 'toString')
at Object.__diacriticSort [as sorter] (dataTables.js:12514:9)
at dataTables.js:5923:19
at Array.sort (<anonymous>)
at _fnSort (dataTables.js:5906:18)
at dataTables.js:5682:7
at dataTables.js:5005:5

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Thank you for letting me know about that!

    I've committed a fix along with your test case, so hopefully that won't creep in again!

    With that change, your example works as expected. I'm planning to do a 2.1.7 release later today which will include this change.

    Allan

  • paulh736paulh736 Posts: 9Questions: 6Answers: 0

    Awesome, thank you!

Sign In or Register to comment.