diff --git a/Client.cpp b/Client.cpp index 4137e481..72573350 100644 --- a/Client.cpp +++ b/Client.cpp @@ -310,6 +310,12 @@ void CClient::ReadLine(const CString& sData) { } #endif + if (!m_pIRCSock) { + PutStatus("Your message to [" + sTarget + "] got lost, " + "you are not connected to IRC!"); + return; + } + CChan* pChan = m_pUser->FindChan(sTarget); if ((pChan) && (pChan->KeepBuffer())) { @@ -532,6 +538,12 @@ void CClient::ReadLine(const CString& sData) { MODULECALL(OnUserMsg(sTarget, sMsg), m_pUser, this, return); #endif + if (!m_pIRCSock) { + PutStatus("Your message to [" + sTarget + "] got lost, " + "you are not connected to IRC!"); + return; + } + CChan* pChan = m_pUser->FindChan(sTarget); if ((pChan) && (pChan->KeepBuffer())) {