I don't know what "the first menu item when entering the character to be printed" means - could you clarify? Could you perhaps give the line that crashes (commented) plus one or two lines each side for context?
e.g.
Code:
some code
some code
some code // this line crashes
some code