discourse/discourse — pull request #1402 by HeroicEric (2013-08-30 04:55:22+00:00)
Title: FIX: Index out of range error

Fixes 'index out of range error' that occurs when viewing a user's
profile page when they haven't yet posted a reply or created a topic
and is @mentioned in a topic.

### Disclaimer

I'm not sure I totally understand what this function is responsible for but the situation described above lead to trying to `insertAt` index 1 of an empty array. This seems to fix the issue and I haven't found any negative side effects.

### Steps to reproduce bug:

- Create a new user
- @mention that new user in a topic
- Try to view their profile page