Avoid IndexOutOfRangeException.

If there is no next message, it should return to a MessageList.
Merge pull request #265 from jca02266/master

If there is no message, it should return to a MessageList.