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(m365 receiver): Add nil check to shutdown #1369

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

dpaasman00
Copy link
Contributor

@dpaasman00 dpaasman00 commented Dec 1, 2023

Proposed Change

The collector panicked with a nil pointer dereference if it was unable to create an authorization token when first started. This occurred because the attempt to create the token happens inside Start() before a cancel func is assigned to the recv. The collector would error out of Start() and then call Shutdown() and encounter the nil pointer dereference when trying to call cancel(). This PR adds a nil check on the cancel funcs before they are called, allowing the collector to fail correctly and not panic with a nil ptr dereference.

Checklist
  • Changes are tested
  • CI has passed

@dpaasman00 dpaasman00 marked this pull request as ready for review December 1, 2023 13:39
@dpaasman00 dpaasman00 requested a review from a team as a code owner December 1, 2023 13:39
@dpaasman00 dpaasman00 requested a review from jsirianni December 1, 2023 13:39
@dpaasman00 dpaasman00 merged commit a9d1b73 into release/v1.41.0 Dec 4, 2023
15 checks passed
@dpaasman00 dpaasman00 deleted the fix/m365-shutdown branch December 4, 2023 20:31
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.

4 participants