From e965b367af1182da98f9470de2fc31568908ae54 Mon Sep 17 00:00:00 2001 From: status102 Date: Sun, 24 Sep 2023 23:11:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20=E7=90=86=E6=99=BA?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=E9=94=99?= =?UTF-8?q?=E8=AF=AF=20=E5=AF=BC=E8=87=B4=E7=9A=84=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Main/AsstProxy.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/MaaWpfGui/Main/AsstProxy.cs b/src/MaaWpfGui/Main/AsstProxy.cs index c0010ec98b..49c3eafe23 100644 --- a/src/MaaWpfGui/Main/AsstProxy.cs +++ b/src/MaaWpfGui/Main/AsstProxy.cs @@ -623,8 +623,19 @@ namespace MaaWpfGui.Main break; } - int[] sanity = sanity_report[0].Split('/').Select(i => Convert.ToInt32(i)).ToArray(); - if (sanity.Length != 2 || sanity[1] <= 1) + // 被污染了直接抛弃 + int[] sanity = sanity_report[0].Split('/').Select(i => + { + try + { + return Convert.ToInt32(i); + } + catch (FormatException) + { + return -1; + } + }).ToArray(); + if (sanity.Length != 2 || sanity[0] < 0 || sanity[1] <= 1) { break; }