fixed sort button

fixed crash at a sort button if array is empty, by disabling the button