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: undefined window throwing error on websocket close #155

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

gismya
Copy link
Contributor

@gismya gismya commented Sep 25, 2023

  • I have added automatic tests where applicable
  • The PR title is suitable as a release note
  • The PR contains a description of what has been changed
  • The description contains manual test instructions

Changes

Solves #154

Previous solution of using if (window?.addEventListener) { only worked for non browser implementations where window was set as undefined, not which never sets window at all. This adds a more thorough check for non-browser implementations to catch errors.

Test

@gismya gismya requested a review from a team as a code owner September 25, 2023 14:40
@gismya gismya merged commit 0f58b6c into main Sep 26, 2023
2 checks passed
@gismya gismya deleted the handling-undefined-window-object branch September 26, 2023 06:34
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