diff --git a/rustplus.js b/rustplus.js index 4497096..aa6e95b 100644 --- a/rustplus.js +++ b/rustplus.js @@ -125,7 +125,7 @@ class RustPlus extends EventEmitter { * @returns {boolean} */ isConnected() { - return (this.websocket.readyState === WebSocket.OPEN); + return (this.websocket && this.websocket.readyState === WebSocket.OPEN); } /**