From e41993ac44fb88f5174c7a1c5bf323b8cc98fbc4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 22 Mar 2018 20:45:26 +0900 Subject: [PATCH] Don't bother with an exception that will never happen Wasn't being caught anyways --- osu.Game/Graphics/ScreenshotManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/ScreenshotManager.cs b/osu.Game/Graphics/ScreenshotManager.cs index c1df7999ad..b0cd997837 100644 --- a/osu.Game/Graphics/ScreenshotManager.cs +++ b/osu.Game/Graphics/ScreenshotManager.cs @@ -60,6 +60,8 @@ namespace osu.Game.Graphics using (var bitmap = await host.TakeScreenshotAsync()) { var fileName = getFileName(); + if (fileName == null) return; + var stream = storage.GetStream(fileName, FileAccess.Write); switch (screenshotFormat.Value) @@ -102,7 +104,7 @@ namespace osu.Game.Graphics return indexedName; } - throw new Exception($"Failed to find suitable file name for saving {fileExt} image"); + return null; } } }