We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 018a745 commit c8f040fCopy full SHA for c8f040f
server/session.go
@@ -65,8 +65,13 @@ func (s *MCPServer) UnregisterSession(
65
ctx context.Context,
66
sessionID string,
67
) {
68
- session, _ := s.sessions.LoadAndDelete(sessionID)
69
- s.hooks.UnregisterSession(ctx, session.(ClientSession))
+ sessionValue, ok := s.sessions.LoadAndDelete(sessionID)
+ if !ok {
70
+ return
71
+ }
72
+ if session, ok := sessionValue.(ClientSession); ok {
73
+ s.hooks.UnregisterSession(ctx, session)
74
75
}
76
77
// SendNotificationToAllClients sends a notification to all the currently active clients.
0 commit comments