mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:47:29 +08:00
Ensure LocalUser is never null
This commit is contained in:
parent
d1c198d9bf
commit
2384f7b0c1
@ -34,7 +34,7 @@ namespace osu.Game.Online.API
|
||||
|
||||
public string Password;
|
||||
|
||||
public Bindable<User> LocalUser = new Bindable<User>();
|
||||
public Bindable<User> LocalUser = new Bindable<User>(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();
|
||||
|
Loading…
Reference in New Issue
Block a user