Skip to content

Commit

Permalink
fix(SocketLayer): throwing if Peer is given a null endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed May 9, 2022
1 parent eb13354 commit 3e3c737
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Assets/Mirage/Runtime/SocketLayer/Peer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public void Bind(IEndPoint endPoint)
public IConnection Connect(IEndPoint endPoint)
{
if (active) throw new InvalidOperationException("Peer is already active");
if (endPoint == null) throw new ArgumentNullException(nameof(endPoint));

active = true;
socket.Connect(endPoint);
Expand Down

0 comments on commit 3e3c737

Please sign in to comment.