1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 17:57:38 +08:00

Ensure LocalUser is never null

This commit is contained in:
Dean Herbert 2017-05-16 19:49:50 +09:00
parent d1c198d9bf
commit 2384f7b0c1

View File

@ -34,7 +34,7 @@ namespace osu.Game.Online.API
public string Password; public string Password;
public Bindable<User> LocalUser = new Bindable<User>(); public Bindable<User> LocalUser = new Bindable<User>(createGustUser());
public string Token public string Token
{ {
@ -295,8 +295,15 @@ namespace osu.Game.Online.API
clearCredentials(); clearCredentials();
authentication.Clear(); authentication.Clear();
State = APIState.Offline; State = APIState.Offline;
LocalUser.Value = createGustUser();
} }
private static User createGustUser() => new User
{
Username = @"Guest",
Id = 1,
};
public void Update() public void Update()
{ {
Scheduler.Update(); Scheduler.Update();