[fix] Check against the readyState of the WebSocket before writing. Fixes #83