Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions weaviate/data/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ func (c *Checker) WithTenant(tenant string) *Checker {
// Do check the specified data object if it exists in weaviate
func (checker *Checker) Do(ctx context.Context) (bool, error) {
responseData, err := checker.connection.RunREST(ctx, checker.buildPath(), http.MethodHead, nil)
// Checking... if responseData is nil before accessing it
// This can happen if the request fails..... e.g. timeout, 504, etc.
if responseData == nil {
Comment on lines +44 to +46
Copy link
Collaborator

@bevzzz bevzzz Feb 20, 2026

Choose a reason for hiding this comment

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

In those cases the returned err will be non-nil, so the condition should be err != nil and not responseData == nil.

return false, except.CheckResponseDataErrorAndStatusCode(responseData, err, 204, 404)
}

exists := responseData.StatusCode == 204
return exists, except.CheckResponseDataErrorAndStatusCode(responseData, err, 204, 404)
}
Expand Down