Skip to content

Commit a2c6f7d

Browse files
fix: Protect against error spams if connection state is messed up (#2770)
1 parent ccd660d commit a2c6f7d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,11 @@ private void ExtractNetworkMetricsForClient(ulong transportClientId)
995995

996996
private void ExtractNetworkMetricsFromPipeline(NetworkPipeline pipeline, NetworkConnection networkConnection)
997997
{
998+
if (m_Driver.GetConnectionState(networkConnection) != NetworkConnection.State.Connected)
999+
{
1000+
return;
1001+
}
1002+
9981003
//Don't need to dispose of the buffers, they are filled with data pointers.
9991004
m_Driver.GetPipelineBuffers(pipeline,
10001005
#if UTP_TRANSPORT_2_0_ABOVE

0 commit comments

Comments
 (0)