Added missing bound checks in the party menu item category list selection handling.

Fix #339 and a few other crashes I discovered along the way.

Thanks to dimproject for the feedback!