I am using the sort_by command

@buddies = @user.buddies.compact.sort_by {|item| item.send @criteria}


problem arise when one criteria like the user.name is nil  the sort 
crash....  anyway to avoid it

thanks a lot for your lights

joss