Skip to content

Commit 73cbb8b

Browse files
authored
Add null check for connectionId (#52672)
1 parent 0bc8a2f commit 73cbb8b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/SignalR/server/Core/src/Internal/Proxies.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ internal sealed class UserProxy<THub> : IClientProxy where THub : Hub
1010

1111
public UserProxy(HubLifetimeManager<THub> lifetimeManager, string userId)
1212
{
13+
ArgumentNullException.ThrowIfNull(userId);
14+
1315
_lifetimeManager = lifetimeManager;
1416
_userId = userId;
1517
}
@@ -44,6 +46,8 @@ internal sealed class GroupProxy<THub> : IClientProxy where THub : Hub
4446

4547
public GroupProxy(HubLifetimeManager<THub> lifetimeManager, string groupName)
4648
{
49+
ArgumentNullException.ThrowIfNull(groupName);
50+
4751
_lifetimeManager = lifetimeManager;
4852
_groupName = groupName;
4953
}
@@ -79,6 +83,8 @@ internal sealed class GroupExceptProxy<THub> : IClientProxy where THub : Hub
7983

8084
public GroupExceptProxy(HubLifetimeManager<THub> lifetimeManager, string groupName, IReadOnlyList<string> excludedConnectionIds)
8185
{
86+
ArgumentNullException.ThrowIfNull(groupName);
87+
8288
_lifetimeManager = lifetimeManager;
8389
_groupName = groupName;
8490
_excludedConnectionIds = excludedConnectionIds;
@@ -147,6 +153,7 @@ internal sealed class SingleClientProxy<THub> : ISingleClientProxy where THub :
147153
public SingleClientProxy(HubLifetimeManager<THub> lifetimeManager, string connectionId)
148154
{
149155
_lifetimeManager = lifetimeManager;
156+
ArgumentNullException.ThrowIfNull(connectionId);
150157
_connectionId = connectionId;
151158
}
152159

0 commit comments

Comments
 (0)