Check IDemoRecorder pointer before use
If the pointer to the IDemoRecorder instance fails to be found after an update, don't try to use it blindly, but check if it's not null before..
This commit is contained in:
@@ -376,7 +376,7 @@ HLTVServerWrapper *HLTVServerWrapperManager::GetWrapper(IDemoRecorder *demorecor
|
||||
for (unsigned int i = 0; i < m_HLTVServers.length(); i++)
|
||||
{
|
||||
HLTVServerWrapper *wrapper = m_HLTVServers[i];
|
||||
if (wrapper->GetDemoRecorder() == demorecorder)
|
||||
if (wrapper->GetDemoRecorder() != nullptr && wrapper->GetDemoRecorder() == demorecorder)
|
||||
return wrapper;
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user