From ac30bb5e2830808793522495a81c6c76aacbcbe9 Mon Sep 17 00:00:00 2001 From: Miepee <38186597+Miepee@users.noreply.github.com> Date: Thu, 23 Sep 2021 13:21:08 +0200 Subject: [PATCH] Don't allow illegal filechars in mod name --- ModPacker.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ModPacker.cs b/ModPacker.cs index 9ec4615..c1b31f8 100644 --- a/ModPacker.cs +++ b/ModPacker.cs @@ -73,6 +73,12 @@ namespace AM2R_ModPacker return; } + if (Path.GetInvalidFileNameChars().Any(NameTextBox.Text.Contains)) + { + MessageBox.Show("Name contains invalid characters! These characters are not allowed:\n" + string.Join("\n", Path.GetInvalidFileNameChars())); + return; + } + CreateLabel.Visible = true; CreateLabel.Text = "Packaging mod(s)... This could take a while!";