From 2167f97f3dd7726712d8d02af02d24bd192d3c6b Mon Sep 17 00:00:00 2001 From: Gabriele Gerbino Date: Fri, 17 Mar 2023 12:03:57 +0100 Subject: [PATCH] fix: return proper error when HTTP calls fail on validate --- utils/defaulter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/defaulter.go b/utils/defaulter.go index 82c7469d2..ddb97daec 100644 --- a/utils/defaulter.go +++ b/utils/defaulter.go @@ -215,6 +215,9 @@ func (d *Defaulter) getEntitySchema(entityType string) (map[string]interface{}, return schema, err } resp, err := d.client.Do(d.ctx, req, &schema) + if resp == nil { + return schema, fmt.Errorf("invalid HTTP response: %w", err) + } // in case the schema is not found - like in case of EE features, // no error should be returned. if resp.StatusCode == http.StatusNotFound {