fix a crash in ChatController