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 Panic when stopping Server before even started #20

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

tretmar
Copy link

@tretmar tretmar commented Apr 19, 2024

Fixing panics happening when the server get's the Stop() function called before it is even started.

By initialising the channel earlier, it can easily be closed.

@tretmar tretmar requested a review from hsteidl April 19, 2024 05:00
@tretmar tretmar added the bug Something isn't working label Apr 19, 2024
@tretmar tretmar self-assigned this Apr 19, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 8748620426

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 89.031%

Totals Coverage Status
Change from base Build 8169798019: 0.006%
Covered Lines: 6526
Relevant Lines: 7330

💛 - Coveralls

@tretmar
Copy link
Author

tretmar commented Apr 19, 2024

Another option btw is to go for stuff like this:

if (channel != nil) {
    close(channel)
}

Copy link

@hsteidl hsteidl left a comment

Choose a reason for hiding this comment

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

👍

@tretmar tretmar merged commit 28c3102 into gridx_extensions Apr 19, 2024
2 checks passed
@tretmar tretmar deleted the fix/fix_close_nil_channel_panic_on_stop branch April 19, 2024 06:42
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
3 participants