Don't place Log.Initialize inside the try-catch block

This commit is contained in:
Deathmax 2011-12-15 21:08:57 +08:00
parent 97b6f77383
commit 3f0d82e5be

View file

@ -108,8 +108,6 @@ namespace TShockAPI
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")]
public override void Initialize() public override void Initialize()
{
try
{ {
HandleCommandLine(Environment.GetCommandLineArgs()); HandleCommandLine(Environment.GetCommandLineArgs());
@ -123,6 +121,8 @@ namespace TShockAPI
#endif #endif
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
try
{
if (File.Exists(Path.Combine(SavePath, "tshock.pid"))) if (File.Exists(Path.Combine(SavePath, "tshock.pid")))
{ {
Log.ConsoleInfo("TShock was improperly shut down. Please avoid this in the future, world corruption may result from this."); Log.ConsoleInfo("TShock was improperly shut down. Please avoid this in the future, world corruption may result from this.");