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
maybeCoerceNumber bombs if coerce produced an object without toString #352
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
@groner is the correct behavior for us to detect there's no |
The bug comes from something A more conservative fix might be to check if |
I ran into this trying to use
pg-connection-string.parse
as a coerce function today, it returns an object with a null prototype which can't be coerced to a string.The original stack trace is lost when it gets converted to YError, but the problem occurs in
looksLikeNumber
when the regexp is applied. It seems to me thatmaybeCoerceNumber
could check if value is a string before doing anything more.The text was updated successfully, but these errors were encountered: