fix crash when reverse sorting an empty list