From 3dbe62f6e4eca59c6129781c0dfb5cd67058075e Mon Sep 17 00:00:00 2001 From: mzack Date: Thu, 23 Mar 2023 09:52:00 +0100 Subject: [PATCH] Adding nil check on url Params --- url/url.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/url/url.go b/url/url.go index 0a60631..2e0356a 100644 --- a/url/url.go +++ b/url/url.go @@ -52,7 +52,9 @@ func (u *URL) Update() { // This is a hot patch for url.URL // parameters are serialized when parsed with `url.Parse()` to avoid this // url should be parsed without parameters and then assigned with url.RawQuery to force unserialized parameters - u.RawQuery = u.Params.Encode() + if u.Params != nil { + u.RawQuery = u.Params.Encode() + } } // Query returns Query Params