fix(data): prevent panic on nil response in checker#308
Open
DEVMANISHOFFL wants to merge 1 commit intoweaviate:mainfrom
Open
fix(data): prevent panic on nil response in checker#308DEVMANISHOFFL wants to merge 1 commit intoweaviate:mainfrom
DEVMANISHOFFL wants to merge 1 commit intoweaviate:mainfrom
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
Author
|
I agree with the CLA. |
bevzzz
reviewed
Feb 20, 2026
Comment on lines
+44
to
+46
| // Checking... if responseData is nil before accessing it | ||
| // This can happen if the request fails..... e.g. timeout, 504, etc. | ||
| if responseData == nil { |
Collaborator
There was a problem hiding this comment.
In those cases the returned err will be non-nil, so the condition should be err != nil and not responseData == nil.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's being changed:
This PR fixes a
nilpointer dereference panic in theChecker.Domethod (Issue #299).When the underlying REST connection fails, such as when it returns a 504 Gateway Timeout or 204 No Content with a nil body in certain edge cases, the
responseDataobject can benil. AccessingresponseData.StatusCodedirectly led to a panic.I added a check to ensure that
responseDatais notnilbefore accessing it.Review checklist