Skip to content
Browse files

Fix #91 - in some rare corner cases, for *-streaming closing might ha…

…ve triggered null exception

Basically, when the close frame went above the data-per-straming connection limit.
  • Loading branch information...
1 parent fc61ea1 commit 8f245ed7e94101383251055cc892dad924dedaa0 @majek majek committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/transport.coffee
View
6 src/transport.coffee
@@ -195,9 +195,11 @@ class Session
@readyState = Transport.CLOSING
@close_frame = closeFrame(status, reason)
if @recv
- # Go away.
+ # Go away. doSendFrame can trigger didClose which can
+ # trigger unregister. Make sure the @recv is not null.
@recv.doSendFrame(@close_frame)
- @recv.didClose()
+ if @recv
+ @recv.didClose()
if @recv
@unregister()
return true

0 comments on commit 8f245ed

Please sign in to comment.
Something went wrong with that request. Please try again.