Skip to content

Commit bd8762d

Browse files
authored
fix for nil resources slice (#665)
* fix for nil resources slice * typo :( --------- Co-authored-by: furysama <furysama.straylight.engineering>
1 parent 59b3a29 commit bd8762d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/server.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,11 @@ func (s *MCPServer) handleListResources(
938938
err: err,
939939
}
940940
}
941+
942+
if resourcesToReturn == nil {
943+
resourcesToReturn = []mcp.Resource{}
944+
}
945+
941946
result := mcp.ListResourcesResult{
942947
Resources: resourcesToReturn,
943948
PaginatedResult: mcp.PaginatedResult{

0 commit comments

Comments
 (0)