Check for tablemodel != null before Sort()