Skip to content

Commit

Permalink
fix(go): check for NPE (#2307)
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp authored Nov 29, 2023
1 parent eba46ba commit 2ba2d6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ func (c *APIClient) WaitForTaskWithContext(
return c.GetTaskWithContext(ctx, c.NewApiGetTaskRequest(indexName, taskID), opts...)
},
func(response *GetTaskResponse, err error) bool {
if err != nil || response == nil {
return false
}

return response.Status == TASKSTATUS_PUBLISHED
},
maxRetries,
Expand Down

0 comments on commit 2ba2d6b

Please sign in to comment.