Fix #9376 (crash when sorting attribute table with no attributes)