From 41d776b0900e9f202a1a34bfc33afaf379dfac08 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 30 Mar 2019 23:56:38 +0900 Subject: [PATCH] Fix stable import failing Regressed due to null GameHost. Fixes the new reports in #4043. --- osu.Desktop/OsuGameDesktop.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 7e5b003f03..e7e0af7eea 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -14,6 +14,7 @@ using osuTK.Input; using Microsoft.Win32; using osu.Desktop.Updater; using osu.Framework; +using osu.Framework.Logging; using osu.Framework.Platform.Windows; using osu.Framework.Screens; using osu.Game.Screens.Menu; @@ -35,12 +36,15 @@ namespace osu.Desktop { try { - return new StableStorage(); + if (Host is DesktopGameHost desktopHost) + return new StableStorage(desktopHost); } - catch + catch (Exception e) { - return null; + Logger.Error(e, "Error while searching for stable install"); } + + return null; } protected override void LoadComplete() @@ -139,8 +143,8 @@ namespace osu.Desktop return null; } - public StableStorage() - : base(string.Empty, null) + public StableStorage(DesktopGameHost host) + : base(string.Empty, host) { } }