Fix null pointer (#57292)

This commit is contained in:
Selene 2022-10-19 19:20:03 +02:00 committed by GitHub
parent 717bd4a6c0
commit 8a35cb57fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,11 +53,12 @@ func (q *queryLibraryAPIClient) update(ctx context.Context, query *querylibrary.
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
defer func() {
_ = resp.Body.Close()
}()
if err != nil {
return err
}
return err
_ = resp.Body.Close()
return nil
}
func (q *queryLibraryAPIClient) delete(ctx context.Context, uid string) error {