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: do not omit args if value is 0 #435

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

ArturSharapov
Copy link
Contributor

@ArturSharapov ArturSharapov commented Jun 22, 2024

This PR fixes quite an obvious bug (an unexpected behavior) in case an argument passed is 0.
The 0 itself is a valid value for the affected arguments COUNT and, most importantly, BLOCK.

  • COUNT 0 should return an empty list (source)
  • BLOCK 0 means to never timeout (source)

However, these arguments are currently omitted entirely when their value is 0.
This is caused by checking the argument values for being truthy that 0 is not a part of.

Proposed changes

Explicitly check argument values for not being undefined (which is the only alternative value other than a number, according to the type definitions).

@uki00a uki00a added the bug Something isn't working label Jun 29, 2024
@uki00a uki00a merged commit dc6c4b3 into denodrivers:master Jun 29, 2024
2 checks passed
@uki00a
Copy link
Member

uki00a commented Jun 29, 2024

LGTM! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants