From 0e4f905a72a42a877f403e5d9e6ebed1885ff0f3 Mon Sep 17 00:00:00 2001 From: vis2k Date: Thu, 19 Jul 2018 20:28:29 +0200 Subject: [PATCH] NetworkConnection.InvokeHandler error messages are now shown if handler not found for msgType instead of failing silently --- Unity-Technologies-networking/Runtime/NetworkConnection.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Unity-Technologies-networking/Runtime/NetworkConnection.cs b/Unity-Technologies-networking/Runtime/NetworkConnection.cs index 64ae26498..374f3e697 100644 --- a/Unity-Technologies-networking/Runtime/NetworkConnection.cs +++ b/Unity-Technologies-networking/Runtime/NetworkConnection.cs @@ -120,14 +120,10 @@ public bool InvokeHandler(short msgType, NetworkReader reader, int channelId) m_MessageInfo.channelId = channelId; NetworkMessageDelegate msgDelegate = m_MessageHandlersDict[msgType]; - if (msgDelegate == null) - { - if (LogFilter.logError) { Debug.LogError("NetworkConnection InvokeHandler no handler for " + msgType); } - return false; - } msgDelegate(m_MessageInfo); return true; } + if (LogFilter.logError) { Debug.LogError("NetworkConnection InvokeHandler no handler for " + msgType); } return false; } @@ -139,6 +135,7 @@ public bool InvokeHandler(NetworkMessage netMsg) msgDelegate(netMsg); return true; } + if (LogFilter.logError) { Debug.LogError("NetworkConnection InvokeHandler no handler for " + netMsg.msgType); } return false; }