Fix crash in NpcScript::onPlayerTrade