You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mourner
changed the title
Writing a string to a varint field can result in a message that cannot be deserialized
writeVarint with a string argument can result in an invalid message
Jul 4, 2016
Example:
Result:
Error: Unimplemented type: 4
It seems to be due to
val
being being coerced intoNaN
. I have not tested if other number types are affected.A simple solution would be to force it to always be a number:
But, maybe it would be better to
if (isNaN(val)) throw new Error()
?The text was updated successfully, but these errors were encountered: