From 883e77bc6045dad05135bf30717fa3530856352e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 13 Apr 2008 04:00:44 +0000 Subject: [PATCH] fixed crash bug (regression) when extensions failed to load --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402055 --- core/systems/ExtensionSys.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/systems/ExtensionSys.cpp b/core/systems/ExtensionSys.cpp index 497ce771..03230ab7 100644 --- a/core/systems/ExtensionSys.cpp +++ b/core/systems/ExtensionSys.cpp @@ -1371,13 +1371,18 @@ IExtension *CExtensionManager::LoadExternal(IExtensionInterface *pInterface, void CExtensionManager::CallOnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax) { + IExtensionInterface *pAPI; List::iterator iter; for (iter=m_Libs.begin(); iter!=m_Libs.end(); iter++) { - if ((*iter)->GetAPI()->GetExtensionVersion() > 3) + if ((pAPI = (*iter)->GetAPI()) == NULL) { - (*iter)->GetAPI()->OnCoreMapStart(pEdictList, edictCount, clientMax); + continue; + } + if (pAPI->GetExtensionVersion() > 3) + { + pAPI->OnCoreMapStart(pEdictList, edictCount, clientMax); } } }