Commit eec28fc
Fix NullReferenceException when request.Params is null in JSON-RPC
When a client omits the "params" field from a JSON-RPC message,
JsonSerializer.Deserialize returns null. Since RequestContext.Params
is now non-nullable, we need to deserialize from an empty JSON object
instead to get a valid default TParams instance.
Co-authored-by: halter73 <54385+halter73@users.noreply.github.com>
Agent-Logs-Url: https://github.com/modelcontextprotocol/csharp-sdk/sessions/1e9aed1a-2748-4117-987c-611e23751bea1 parent db960e6 commit eec28fc
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
0 commit comments