Avoid sending blank messages to users.

This commit is contained in:
Sadie Powell 2024-07-19 01:34:52 +01:00
parent 0cf17f6e33
commit d2fcfeac8b

View File

@ -707,14 +707,11 @@ void LocalUser::ChangeConnectClass(const std::shared_ptr<ConnectClass>& klass, b
void LocalUser::Write(const ClientProtocol::SerializedMessage& text)
{
if (!eh.HasFd())
if (!eh.HasFd() || text.empty())
return;
if (ServerInstance->Config->RawLog)
{
if (text.empty())
return;
std::string::size_type nlpos = text.find_first_of("\r\n", 0, 2);
if (nlpos == std::string::npos)
nlpos = text.length();