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: prevent npe by handling checking error in NewAnalysis call #1365

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

pintohutch
Copy link
Contributor

If there is an issue in creating the Analysis config when calling analysis.NewAnalysis, then we want to check before assigning the context to a potentially nil pointer.

Closes #

πŸ“‘ Description

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

β„Ή Additional Information

@pintohutch pintohutch requested review from a team as code owners January 23, 2025 23:03
If there is an issue in creating the Analysis config when calling
analysis.NewAnalysis, then we want to check before assigning the context to a
potentially nil pointer.

Signed-off-by: Danny Clark <[email protected]>
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 34.12%. Comparing base (173e4dc) to head (ab0e673).
Report is 48 commits behind head on main.

Files with missing lines Patch % Lines
pkg/server/analyze/analyze.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1365      +/-   ##
==========================================
- Coverage   34.76%   34.12%   -0.65%     
==========================================
  Files          94       97       +3     
  Lines        6342     6500     +158     
==========================================
+ Hits         2205     2218      +13     
- Misses       4046     4189     +143     
- Partials       91       93       +2     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

Copy link
Member

@AlexsJones AlexsJones left a comment

Choose a reason for hiding this comment

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

Good spot thanks

@AlexsJones AlexsJones merged commit 83672fa into k8sgpt-ai:main Jan 31, 2025
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants