fix null environment variable crash

This commit is contained in:
mark 2006-06-16 22:33:26 +00:00
parent 3d09d84101
commit 539954ba13

View file

@ -338,7 +338,9 @@ namespace Server {
if ( s.Length > 0 )
Console.WriteLine( "Core: Running with arguments: {0}", s );
int processorCount = Utility.ToInt32( Environment.GetEnvironmentVariable( "NUMBER_OF_PROCESSORS" ) );
string pCount = Environment.GetEnvironmentVariable( "NUMBER_OF_PROCESSORS" );
int processorCount = ( pCount != null ? Utility.ToInt32( pCount ) : 1 );
if ( processorCount > 1 )
m_MultiProcessor = true;