I think this crash happens if you press enter when having an empty inventory slot selected, so you can avoid it