Fixed sub editor crashing when attempting to use illegal characters in the filename. Closes #207
This commit is contained in:
@@ -378,12 +378,15 @@ namespace Barotrauma
|
||||
nameBox.Flash();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nameBox.Text.Contains("../"))
|
||||
|
||||
foreach (char illegalChar in Path.GetInvalidFileNameChars())
|
||||
{
|
||||
DebugConsole.ThrowError("Illegal symbols in filename (../)");
|
||||
nameBox.Flash();
|
||||
return false;
|
||||
if (nameBox.Text.Contains(illegalChar))
|
||||
{
|
||||
GUI.AddMessage(TextManager.Get("SubNameIllegalCharsWarning").Replace("[illegalchar]", illegalChar.ToString()), Color.Red, 3.0f);
|
||||
nameBox.Flash();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
string savePath = nameBox.Text + ".sub";
|
||||
|
||||
Reference in New Issue
Block a user