Trim mod name from whitespaces before using

pull/16/head
Miepee 3 years ago
parent 9526ab0c45
commit 30ac639ba1

@ -134,6 +134,10 @@ public partial class ModPacker : Form
return;
}
// Trim the mod name textbox so that it has no leading/ending whitespace.
// Also check for invalid file names
nameTextBox.Text = nameTextBox.Text.Trim();
if (Path.GetInvalidFileNameChars().Any(nameTextBox.Text.Contains))
{
MessageBox.Show("Name contains invalid characters! These characters are not allowed:\n" + String.Join("\n", Path.GetInvalidFileNameChars()));

Loading…
Cancel
Save