fix null environment variable crash
This commit is contained in:
parent
3d09d84101
commit
539954ba13
1 changed files with 3 additions and 1 deletions
|
|
@ -338,7 +338,9 @@ namespace Server {
|
||||||
if ( s.Length > 0 )
|
if ( s.Length > 0 )
|
||||||
Console.WriteLine( "Core: Running with arguments: {0}", s );
|
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 )
|
if ( processorCount > 1 )
|
||||||
m_MultiProcessor = true;
|
m_MultiProcessor = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue