防止重复报错

This commit is contained in:
ZouJin 2024-04-12 12:56:53 +08:00
parent 3b72d4432d
commit 344053ff4a

View File

@ -44,10 +44,13 @@ namespace VPet_Simulator.Windows
MutiSaves.Add("");
}
}
HashSet<string> ErrorReport = new HashSet<string>();
private void UnhandledException(Exception e, bool isFatality)
{
var expt = e.ToString();
if (ErrorReport.Contains(expt))
return;//防止重复报错
ErrorReport.Add(expt);
if (expt.Contains("MainWindow.Close"))
return;
else if ((!isFatality && MainWindow != null && ((MainWindow)MainWindow).GameSavesData?.GameSave != null &&