Fixed a crash when the client disconnected abruptly