Fixed vgui screens potentially crashing on save

This commit is contained in:
Peter Covington 2023-08-05 18:38:04 -04:00
parent 146df3c961
commit eb46739ab5
No known key found for this signature in database
GPG Key ID: CE9E79A4A4BDE09B

View File

@ -82,7 +82,11 @@ bool CVGuiScreen::KeyValue( const char *szKeyName, const char *szValue )
const char* pszOutputName = szKeyName + 1;
int i = m_PanelOutputs.Find(pszOutputName);
if (!m_PanelOutputs.IsValidIndex(i))
i = m_PanelOutputs.Insert(pszOutputName, new COutputEvent);
{
auto pMem = new COutputEvent;
V_memset(pMem, 0, sizeof(COutputEvent));
i = m_PanelOutputs.Insert(pszOutputName, pMem);
}
m_PanelOutputs[i]->ParseEventAction(szValue);
return true;