From ad7a795434cb9ee3918c1eea8296ce2c7844f4f8 Mon Sep 17 00:00:00 2001 From: FRUP Date: Sun, 1 Mar 2020 16:30:21 -0800 Subject: [PATCH] fix conversion crashing the game when exceptions are thrown --- CHANGELOG.md | 1 + Pulsarc/Pulsarc.cs | 19 ++++++++++++++++--- Pulsarc/Pulsarc.csproj | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45b8041..f58138b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - The handling of Intralism maps with config v3, encrypted data, and/or Unlock Conditions. +- A game crash when converting invalid maps. ## [1.4.0-alpha] - 2020-02-24 diff --git a/Pulsarc/Pulsarc.cs b/Pulsarc/Pulsarc.cs index 9f8e81f..e35a46c 100644 --- a/Pulsarc/Pulsarc.cs +++ b/Pulsarc/Pulsarc.cs @@ -259,14 +259,27 @@ private async void ConvertMaps() { for (int i = 0; i < directories.Length; i++) { - converter.Save(directories[i]); + try + { + converter.Save(directories[i]); + } + catch + { + PulsarcLogger.Warning($"Couldn't convert {directories[i]}"); + } } } - // Otherwise convert one map else { - converter.Save(toConvert); + try + { + converter.Save(toConvert); + } + catch + { + PulsarcLogger.Warning($"Couldn't convert {toConvert}"); + } } ((SongSelection)ScreenManager.Screens.Peek()).RescanBeatmaps(); diff --git a/Pulsarc/Pulsarc.csproj b/Pulsarc/Pulsarc.csproj index 8c604a2..6b03e7a 100644 --- a/Pulsarc/Pulsarc.csproj +++ b/Pulsarc/Pulsarc.csproj @@ -9,8 +9,8 @@ Pulsarc Icon.ico - 1.4.0.0 - 1.4.0.0 + 1.4.1.0 + 1.4.1.0