core/PluginSys.cpp
changeset 3509 f5494c328158
parent 3507 d1b6fde18611
child 3601 d3a2fb7b3a1e
     1.1 --- a/core/PluginSys.cpp	Sun May 27 01:51:02 2012 +0100
     1.2 +++ b/core/PluginSys.cpp	Sun May 27 01:51:03 2012 +0100
     1.3 @@ -1005,11 +1005,14 @@
     1.4  		pPlugin->m_pRuntime = g_pSourcePawn2->LoadPlugin(co, fullpath, &err);
     1.5  		if (pPlugin->m_pRuntime == NULL)
     1.6  		{
     1.7 -			UTIL_Format(error, 
     1.8 -				maxlength, 
     1.9 -				"Unable to load plugin (error %d: %s)", 
    1.10 -				err, 
    1.11 -				g_pSourcePawn2->GetErrorString(err));
    1.12 +			if (error)
    1.13 +			{
    1.14 +				UTIL_Format(error, 
    1.15 +					maxlength, 
    1.16 +					"Unable to load plugin (error %d: %s)", 
    1.17 +					err, 
    1.18 +					g_pSourcePawn2->GetErrorString(err));
    1.19 +			}
    1.20  			pPlugin->m_status = Plugin_BadLoad;
    1.21  		}
    1.22  		else
    1.23 @@ -1020,7 +1023,10 @@
    1.24  			}
    1.25  			else
    1.26  			{
    1.27 -				UTIL_Format(error, maxlength, "%s", pPlugin->m_errormsg);
    1.28 +				if (error)
    1.29 +				{
    1.30 +					UTIL_Format(error, maxlength, "%s", pPlugin->m_errormsg);
    1.31 +				}
    1.32  			}
    1.33  		}
    1.34  	}