From 2384f7b0c132597dd88ee7e395fcbb7b8bb6ada7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 May 2017 19:49:50 +0900 Subject: [PATCH] Ensure LocalUser is never null --- osu.Game/Online/API/APIAccess.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index c4b679fc92..e56e4efe24 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -34,7 +34,7 @@ namespace osu.Game.Online.API public string Password; - public Bindable LocalUser = new Bindable(); + public Bindable LocalUser = new Bindable(createGustUser()); public string Token { @@ -295,8 +295,15 @@ namespace osu.Game.Online.API clearCredentials(); authentication.Clear(); State = APIState.Offline; + LocalUser.Value = createGustUser(); } + private static User createGustUser() => new User + { + Username = @"Guest", + Id = 1, + }; + public void Update() { Scheduler.Update();