diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs index 8cf694fa42..8f5c92c25f 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs @@ -15,6 +15,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Text.RegularExpressions; using System.Threading.Tasks; using MaaWpfGui.Constants; using MaaWpfGui.Helper; @@ -232,11 +233,15 @@ public class GameSettingsUserControlModel : PropertyChangedBase { try { + scriptPath = scriptPath.Trim(); + if (string.IsNullOrWhiteSpace(scriptPath)) { return false; } + scriptPath = Regex.Replace(scriptPath, @"\p{C}", string.Empty); + string fileName; string arguments;