Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow toBuffer to work with empty data #179

Closed
wants to merge 1 commit into from

Conversation

clehner
Copy link

@clehner clehner commented Jan 17, 2015

I was seeing this error:

TypeError: Cannot call method 'copy' of undefined
    at WebSocketFrame.toBuffer (/srv/http/myapp/node_modules/websocket/lib/WebSocketFrame.js:266:14)
    at WebSocketConnection.sendFrame (/srv/http/myapp/node_modules/websocket/lib/WebSocketConnection.js:821:43)
    at WebSocketConnection.ping (/srv/http/myapp/node_modules/websocket/lib/WebSocketConnection.js:726:10)
    at WebSocketConnection.handleKeepaliveTimer (/srv/http/myapp/node_modules/websocket/lib/WebSocketConnection.js:217:10)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

I investigated only as far as to see that making sure data is set to a buffer prevents the error from occurring.

@theturtle32
Copy link
Owner

Published fixed version as v1.0.17

@clehner
Copy link
Author

clehner commented Jan 17, 2015

Great, that is a better solution.

danhounshell added a commit to danhounshell/autohost that referenced this pull request Jan 20, 2015
to fix issue we were seeing when running integration.api and has been
fixed in library here:
theturtle32/WebSocket-Node#179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants