Fixed crash.

messages_selection() didn't handle cases where nothing was selected.