ensure index is not nil before attempting sort in Field#<=>