Skip to content

Conversation

@mkayander
Copy link

@mkayander mkayander commented Jan 10, 2024

This PR fixes #1258 issue, a _shutdownStatsbeat function should not be called if it is undefined.

The constructor parameter is optional, however, the according class property is not.
There is a nullability check in one of the methods, but not in the res.on("end", ... handler. This causes errors when the callback is not provided.

I've made the class property type nullable as well for convenience, but unfortunately, TS strict mode is turned off in this project. As a result, that kind of nullability issues are not caught by TS.

Copy link
Contributor

@JacksonWeber JacksonWeber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JacksonWeber JacksonWeber self-requested a review January 11, 2024 00:28
@JacksonWeber
Copy link
Contributor

Looks good, and makes sense that we need to fix the case where that function could be undefined. Thanks for the contribution!

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.

Incorrect shutdownStatsbeat optional parameter handling (TypeError: _this._shutdownStatsbeat is not a function)

3 participants