It's a null exception problem. Same thing happens if you try to pickpocket an npc that died (as in you had right click menu open already and the NPC catches you. You kill NPC but not close right click menu. If you try doing any action you crash. An exception handler would fix this.
For non programmers, this mean the client is trying to do something to something but doesn't know where that something is.