diff --git a/TShockAPI/Log.cs b/TShockAPI/Log.cs index 4bbd05ac..77e8ff86 100644 --- a/TShockAPI/Log.cs +++ b/TShockAPI/Log.cs @@ -160,10 +160,20 @@ namespace TShockAPI caller = meth.DeclaringType.Name; } - _logWriter.WriteLine(string.Format("{0} - {1}: {2}: {3}", - DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), - caller, level.ToString().ToUpper(), message)); - _logWriter.Flush(); + try + { + _logWriter.WriteLine(string.Format("{0} - {1}: {2}: {3}", + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), + caller, level.ToString().ToUpper(), message)); + _logWriter.Flush(); + } + catch (ObjectDisposedException) + { + Console.WriteLine("Unable to write to log as log has been disposed."); + Console.WriteLine("{0} - {1}: {2}: {3}", + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture), + caller, level.ToString().ToUpper(), message); + } } } } \ No newline at end of file diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index a8d53f8f..be5aae10 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -48,5 +48,5 @@ using System.Runtime.InteropServices; // Build Number // MMdd of the build -[assembly: AssemblyVersion("3.4.5.0114")] -[assembly: AssemblyFileVersion("3.4.5.0114")] +[assembly: AssemblyVersion("3.4.5.0115")] +[assembly: AssemblyFileVersion("3.4.5.0115")]