mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Netconsole: don't process empty input strings
Caught by assert in CUtlBuffer ctor when tokenizing the input.
This commit is contained in:
parent
3c10bf0e8d
commit
cb8f0902a4
@ -181,7 +181,11 @@ void CNetCon::TermSetup(const bool bAnsiColor)
|
||||
//-----------------------------------------------------------------------------
|
||||
void CNetCon::RunInput(const string& lineInput)
|
||||
{
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
if (lineInput.empty())
|
||||
{
|
||||
// Empty string given, don't process it.
|
||||
return;
|
||||
}
|
||||
|
||||
if (lineInput.compare("nquit") == 0)
|
||||
{
|
||||
@ -189,6 +193,8 @@ void CNetCon::RunInput(const string& lineInput)
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> l(m_Mutex);
|
||||
|
||||
if (IsConnected())
|
||||
{
|
||||
CCommand cmd;
|
||||
@ -218,7 +224,7 @@ void CNetCon::RunInput(const string& lineInput)
|
||||
cl_rcon::request_t::SERVERDATA_REQUEST_EXECCOMMAND);
|
||||
}
|
||||
}
|
||||
else if (!lineInput.empty()) // Single arg command query.
|
||||
else // Single arg command query.
|
||||
{
|
||||
bSend = Serialize(vecMsg, lineInput.c_str(), "", cl_rcon::request_t::SERVERDATA_REQUEST_EXECCOMMAND);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user