From 3e9ad07d8530021da49c5678de65c5016c1b8e7a Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 12 Sep 2011 17:31:13 +0200 Subject: [PATCH] Fix a crash with OnClientLogin() A client doesn't necessarily have a network after logging in (e.g. could have used an invalid network name). This is another crash found by exoa, thanks. Signed-off-by: Uli Schlachter --- Client.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Client.cpp b/Client.cpp index aded3c1e..df0f3e6e 100644 --- a/Client.cpp +++ b/Client.cpp @@ -666,7 +666,11 @@ void CClient::AcceptLogin(CUser& User) { SendMotd(); - NETWORKMODULECALL(OnClientLogin(), m_pUser, m_pNetwork, this, NOTHING); + if (m_pNetwork) { + NETWORKMODULECALL(OnClientLogin(), m_pUser, m_pNetwork, this, NOTHING); + } else { + USERMODULECALL(OnClientLogin(), m_pUser, this, NOTHING); + } } void CClient::Timeout() {