mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix crash when log file is in same folder
Fix #64 by adding an additional check Bug report by JamieSinn (thanks!)
This commit is contained in:
parent
c4628ba889
commit
57024a7b26
1 changed files with 3 additions and 1 deletions
|
|
@ -92,7 +92,9 @@ namespace MinecraftClient.ChatBots
|
|||
if (dateandtime)
|
||||
tosave = getTimestamp() + ' ' + tosave;
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(logfile));
|
||||
string directory = Path.GetDirectoryName(logfile);
|
||||
if (!String.IsNullOrEmpty(directory) && !Directory.Exists(directory))
|
||||
Directory.CreateDirectory(directory);
|
||||
FileStream stream = new FileStream(logfile, FileMode.OpenOrCreate);
|
||||
StreamWriter writer = new StreamWriter(stream);
|
||||
stream.Seek(0, SeekOrigin.End);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue