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(types): missing null declaration for error in subscription callback #1589

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

dachrillz
Copy link
Contributor

The callback that can be passed to client.subscribe can be invoked with null as observed in link below,

callback(null, [])

The type of the callback does not reflect this and assumes an error is always present. This patch fixes this.

The callback that can be passed to client.subscribe can be invoked with null as observed in link below,
https://github.com/mqttjs/MQTT.js/blob/b3ce3da84147c86eb176759f53fa929e96de7969/lib/client.js#L784

The type of the callback does not reflect this and assumes an error is always present. This patch fixes this.
@robertsLando robertsLando changed the title fix missing null declaration for error in subscription callback fix(types): missing null declaration for error in subscription callback Jun 23, 2023
@robertsLando robertsLando merged commit afc067b into mqttjs:main Jun 23, 2023
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