fix: EdgegapKcp StopHost() null reference exception (#3779)

see https://github.com/MirrorNetworking/Mirror/issues/3708
This commit is contained in:
Robin Rolf 2024-03-11 16:35:21 +00:00 committed by GitHub
parent 0aa8000454
commit fafc10b639
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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