lib/faye/websocket/api.rb in faye-websocket-0.6.1 vs lib/faye/websocket/api.rb in faye-websocket-0.6.2
- old
+ new
@@ -67,10 +67,10 @@
def finalize(reason = nil, code = nil)
return if @ready_state == CLOSED
@ready_state = CLOSED
EventMachine.cancel_timer(@ping_timer) if @ping_timer
- @stream.close_connection_after_writing
+ @stream.close_connection_after_writing if @stream
event = Event.new('close', :code => code || 1000, :reason => reason || '')
event.init_event('close', false, false)
dispatch_event(event)
end