mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
防止重复报错
This commit is contained in:
parent
3b72d4432d
commit
344053ff4a
@ -44,10 +44,13 @@ namespace VPet_Simulator.Windows
|
|||||||
MutiSaves.Add("");
|
MutiSaves.Add("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
HashSet<string> ErrorReport = new HashSet<string>();
|
||||||
private void UnhandledException(Exception e, bool isFatality)
|
private void UnhandledException(Exception e, bool isFatality)
|
||||||
{
|
{
|
||||||
var expt = e.ToString();
|
var expt = e.ToString();
|
||||||
|
if (ErrorReport.Contains(expt))
|
||||||
|
return;//防止重复报错
|
||||||
|
ErrorReport.Add(expt);
|
||||||
if (expt.Contains("MainWindow.Close"))
|
if (expt.Contains("MainWindow.Close"))
|
||||||
return;
|
return;
|
||||||
else if ((!isFatality && MainWindow != null && ((MainWindow)MainWindow).GameSavesData?.GameSave != null &&
|
else if ((!isFatality && MainWindow != null && ((MainWindow)MainWindow).GameSavesData?.GameSave != null &&
|
||||||
|
Loading…
Reference in New Issue
Block a user