From 3c54f3d39ee869e2b3b13df3aa06f89c3748ef73 Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 17 Oct 2024 17:04:09 +0200 Subject: [PATCH] nats discovery --- tools/remote_caller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/remote_caller.go b/tools/remote_caller.go index 986819f..a444427 100644 --- a/tools/remote_caller.go +++ b/tools/remote_caller.go @@ -77,7 +77,7 @@ func (caller *HTTPCaller) CallPost(url string, subpath string, body map[string]i postBody, _ := json.Marshal(body) responseBody := bytes.NewBuffer(postBody) resp, err := http.Post(url+subpath, "application/json", responseBody) - if err != nil { + if err != nil || resp == nil || resp.Body == nil { return nil, err } defer resp.Body.Close()