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

Fix type assertion for counters in packetHandler func #80

Merged
merged 1 commit into from
Apr 12, 2016

Conversation

stevefranks
Copy link
Contributor

If the Packet type is a counter then the the value that gets parsed from the input is a float64 here. This value is then passed to the packetHandler function here (of which line 188 that that contains the change in question is a part of) through the Packet structure in a variable whose initial type is an interface here. When the value is accessed the type assertion needs to match the type of the value (which is a float) that is to be extracted from the interface or else the program will and does crash.

I have updated the tests and the program passes all of them.

@ploxiln
Copy link
Contributor

ploxiln commented Apr 12, 2016

Wow... clearly haven't started running the latest code in production yet. Thanks for the heads-up and the patch, much appreciated.

bug was introduced in #68 / #77 and is not present in the last "release" v0.7.1

👍 for this fix

@jehiah jehiah added the bug label Apr 12, 2016
@jehiah
Copy link
Member

jehiah commented Apr 12, 2016

thanks @stevefranks !

@jehiah jehiah merged commit ae50076 into bitly:master Apr 12, 2016
@stevefranks
Copy link
Contributor Author

🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants