Skip to content

Commit 7a4f615

Browse files
authored
Add null check to Client.TimeoutTime setter (#168)
Connection can be null if you set the timeout time before starting a connection, which would result in a null exception
1 parent 799942f commit 7a4f615

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

RiptideNetworking/RiptideNetworking/Client.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ public override int TimeoutTime
4040
set
4141
{
4242
defaultTimeout = value;
43-
connection.TimeoutTime = defaultTimeout;
43+
if (connection != null)
44+
{
45+
connection.TimeoutTime = defaultTimeout;
46+
}
4447
}
4548
}
4649
/// <summary>Whether or not the client is currently <i>not</i> trying to connect, pending, nor actively connected.</summary>

0 commit comments

Comments
 (0)