Skip to content

Commit fd36bab

Browse files
author
Dan Ordille
committed
Fix possible race condition in websocket heartbeat callback
1 parent c7f9a5f commit fd36bab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/trans-websocket.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ class WebSocketReceiver extends transport.GenericReceiver
101101
super
102102

103103
heartbeat_timeout: ->
104-
@session.close(3000, 'No response from heartbeat')
104+
if @session?
105+
@session.close(3000, 'No response from heartbeat')
105106

106107

107108

0 commit comments

Comments
 (0)