Prevent invalid chars in logfile path

A proper error message is shown and bot is unloaded. Fix #153
This commit is contained in:
ORelio 2016-05-15 14:37:06 +02:00
parent 66d57b0ce6
commit c6c0c0e3a7

View file

@ -53,6 +53,11 @@ namespace MinecraftClient.ChatBots
saveChat = false;
break;
}
if (String.IsNullOrEmpty(file) || file.IndexOfAny(Path.GetInvalidPathChars()) >= 0)
{
LogToConsole("Path '" + file + "' contains invalid characters.");
UnloadBot();
}
}
public static MessageFilter str2filter(string filtername)