From d93d9e619019ab0b34f1a3a618ea9de8f2f8e47c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Jul 2017 15:08:56 +0900 Subject: [PATCH] Tidy up file deletion after import --- osu.Game/Beatmaps/BeatmapManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 16a1268e88..646ae3fae9 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -87,11 +87,12 @@ namespace osu.Game.Beatmaps // TODO: Add a check to prevent files from storage to be deleted. try { - File.Delete(path); + if (File.Exists(path)) + File.Delete(path); } catch (Exception e) { - Logger.Error(e, $@"Could not delete file at {path}"); + Logger.Error(e, $@"Could not delete original file after import ({Path.GetFileName(path)})"); } } catch (Exception e)