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

return on first error to avoid writing invalid bytes #16

Merged
merged 2 commits into from
Sep 13, 2016

Conversation

jdiamond
Copy link
Contributor

@jdiamond jdiamond commented Sep 9, 2016

I added return to all the lines that emit error events. This stops writing bytes to the output stream that we know are invalid.

@mcollina
Copy link
Member

Thanks @jdiamond! We should return either true or false. stream.emit('error') returns the streams, which is truthy, and that might cause issues. I think we should return false.

@mcollina mcollina merged commit c0a1721 into mqttjs:master Sep 13, 2016
@mcollina
Copy link
Member

Perfect, thanks!

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