Skip to content

only calling onClose if it's not nil#39

Merged
WendelHime merged 1 commit intomainfrom
fix/check-onclose-before-calling
Sep 12, 2025
Merged

only calling onClose if it's not nil#39
WendelHime merged 1 commit intomainfrom
fix/check-onclose-before-calling

Conversation

@WendelHime
Copy link
Copy Markdown
Contributor

@WendelHime WendelHime commented Sep 12, 2025

fix getlantern/engineering#2551

@WendelHime WendelHime marked this pull request as ready for review September 12, 2025 21:11
Copilot AI review requested due to automatic review settings September 12, 2025 21:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds nil checks before calling the onClose callback function in two methods to prevent potential nil pointer dereferences.

  • Added nil checks for the onClose parameter in NewConnectionEx and NewPacketConnectionEx methods
  • Ensures safe execution of the callback function when it might be nil

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@WendelHime WendelHime merged commit f05099d into main Sep 12, 2025
1 check passed
@WendelHime WendelHime deleted the fix/check-onclose-before-calling branch September 12, 2025 21:12
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.

3 participants