From 6e9712a37a5b391274b0a1c9eaac979e97d92cf2 Mon Sep 17 00:00:00 2001 From: MgAl2O4 <51430403+MgAl2O4@users.noreply.github.com> Date: Mon, 15 Feb 2021 20:20:24 -0500 Subject: [PATCH] fixed crash on saving screenshot --- SINoCOLO/MainForm.cs | 19 +++++++++++++------ SINoCOLO/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/SINoCOLO/MainForm.cs b/SINoCOLO/MainForm.cs index b7ad795..b776789 100644 --- a/SINoCOLO/MainForm.cs +++ b/SINoCOLO/MainForm.cs @@ -73,18 +73,25 @@ private void GameLogic_OnMouseClickRequested(int posX, int posY) private void GameLogic_OnSaveScreenshot() { - if (cachedSourceScreen != null) + try { - for (int idx = 1; idx < 1000000; idx++) + if (cachedSourceScreen != null) { - string testPath = "screenshot-" + idx + ".jpg"; - if (!System.IO.File.Exists(testPath)) + for (int idx = 1; idx < 1000000; idx++) { - cachedSourceScreen.Save(testPath); - break; + string testPath = "screenshot-" + idx + ".jpg"; + if (!System.IO.File.Exists(testPath)) + { + cachedSourceScreen.Save(testPath); + break; + } } } } + catch (Exception ex) + { + Console.WriteLine("Exception on saving:" + ex); + } } private void GameLogic_OnEventCounterUpdated() diff --git a/SINoCOLO/Properties/AssemblyInfo.cs b/SINoCOLO/Properties/AssemblyInfo.cs index 197b63e..130d0a8 100644 --- a/SINoCOLO/Properties/AssemblyInfo.cs +++ b/SINoCOLO/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("23.0.0.0")] -[assembly: AssemblyFileVersion("23.0.0.0")] +[assembly: AssemblyVersion("24.0.0.0")] +[assembly: AssemblyFileVersion("24.0.0.0")]