From e91efce7db48357c51a58285916c8e3f5a481eda Mon Sep 17 00:00:00 2001 From: mayuri0v0 Date: Thu, 18 Dec 2025 13:20:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E7=9A=84=E7=A9=BA=E6=A0=BC=E4=B8=8E=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=AD=97=E7=AC=A6=20(#15082)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 去除路径左右的空格与控制字符 * fix: 忘了调库了 * fix: 忘了调库了 --- .../UserControl/Settings/GameSettingsUserControlModel.cs | 5 +++++ 1 file changed, 5 insertions(+) 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;