fix sorting with null optional value
Merge pull request #325 from nikola-kocic/master

fix sorting with null optional value