lib/sinatra/websocketio/client.rb in sinatra-websocketio-0.4.0 vs lib/sinatra/websocketio/client.rb in sinatra-websocketio-0.4.1
- old
+ new
@@ -83,10 +83,10 @@
return self
end
def close
@running = false
- @websocket.close
+ @websocket.close if @websocket
end
def push(type, data)
if !@connecting
emit :error, 'websocket not connecting'