Skip to content

Commit 552c49d

Browse files
committed
Fix null value conversation error
Signed-off-by: AnyISalIn <anyisalin@gmail.com>
1 parent 9a26de6 commit 552c49d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

utils/adapter.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ func NewToolHandler(method string, url string, extraHeaders map[string]string) f
9999
switch v := paramValue.(type) {
100100
case string:
101101
strValue = v
102+
case nil:
103+
// Use empty string for nil path parameters
104+
strValue = ""
102105
default:
103106
// Convert other types to string
104107
strValue = fmt.Sprintf("%v", v)
@@ -126,6 +129,8 @@ func NewToolHandler(method string, url string, extraHeaders map[string]string) f
126129
switch v := paramValue.(type) {
127130
case string:
128131
strValue = v
132+
case nil:
133+
continue
129134
default:
130135
// Convert other types to string
131136
strValue = fmt.Sprintf("%v", v)

0 commit comments

Comments
 (0)