Sanitize filename before try write

Closes #2656 ty @xJam-es !
This commit is contained in:
Kurt 2020-01-23 08:35:12 -08:00
parent ecfcbbc4cb
commit 8f89346681

View file

@ -158,7 +158,7 @@ namespace PKHeX.WinForms
var folder = fbd.SelectedPath; var folder = fbd.SelectedPath;
foreach (var gpk in gofiles) foreach (var gpk in gofiles)
File.WriteAllBytes(Path.Combine(folder, gpk.FileName), gpk.Data); File.WriteAllBytes(Path.Combine(folder, Util.CleanFileName(gpk.FileName)), gpk.Data);
WinFormsUtil.Alert($"Dumped {gofiles.Length} files to {folder}"); WinFormsUtil.Alert($"Dumped {gofiles.Length} files to {folder}");
} }