From 539954ba13604c3587c8185d71a127f6fe26cbcd Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 16 Jun 2006 22:33:26 +0000 Subject: [PATCH] fix null environment variable crash --- Server/Main.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Server/Main.cs b/Server/Main.cs index b39eee215..de85f83ff 100644 --- a/Server/Main.cs +++ b/Server/Main.cs @@ -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;