fix: #3876 KcpTransport OnClientError null handling during shutdown

This commit is contained in:
mischa 2024-10-29 08:54:19 +01:00
parent c80a3c8ea5
commit 03357f4275

View File

@ -116,7 +116,7 @@ protected virtual void Awake()
() => OnClientConnected.Invoke(), () => OnClientConnected.Invoke(),
(message, channel) => OnClientDataReceived.Invoke(message, FromKcpChannel(channel)), (message, channel) => OnClientDataReceived.Invoke(message, FromKcpChannel(channel)),
() => OnClientDisconnected?.Invoke(), // may be null in StopHost(): https://github.com/MirrorNetworking/Mirror/issues/3708 () => OnClientDisconnected?.Invoke(), // may be null in StopHost(): https://github.com/MirrorNetworking/Mirror/issues/3708
(error, reason) => OnClientError.Invoke(ToTransportError(error), reason), (error, reason) => OnClientError?.Invoke(ToTransportError(error), reason), // may be null during shutdown: https://github.com/MirrorNetworking/Mirror/issues/3876
config config
); );