mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 00:33:21 +08:00
Handle nulls and fix missing documentation
This commit is contained in:
parent
77adf687c6
commit
459f9a0465
@ -32,7 +32,7 @@ namespace osu.Game.Database
|
||||
/// </summary>
|
||||
/// <param name="userIds">The users to lookup.</param>
|
||||
/// <param name="token">An optional cancellation token.</param>
|
||||
/// <returns>.</returns>
|
||||
/// <returns>The populated users. May include null results for failed retrievals.</returns>
|
||||
public Task<User[]> GetUsersAsync(int[] userIds, CancellationToken token = default)
|
||||
{
|
||||
var userLookupTasks = new List<Task<User>>();
|
||||
|
@ -57,6 +57,9 @@ namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
foreach (var user in users.Result)
|
||||
{
|
||||
if (user == null)
|
||||
continue;
|
||||
|
||||
var trackedUser = CreateUserData(user.Id, scoreProcessor);
|
||||
trackedUser.ScoringMode.BindTo(scoringMode);
|
||||
|
||||
|
@ -63,7 +63,12 @@ namespace osu.Game.Screens.Spectate
|
||||
userLookupCache.GetUsersAsync(userIds.ToArray()).ContinueWith(users => Schedule(() =>
|
||||
{
|
||||
foreach (var u in users.Result)
|
||||
{
|
||||
if (u == null)
|
||||
continue;
|
||||
|
||||
userMap[u.Id] = u;
|
||||
}
|
||||
|
||||
playingUserStates.BindTo(spectatorClient.PlayingUserStates);
|
||||
playingUserStates.BindCollectionChanged(onPlayingUserStatesChanged, true);
|
||||
|
Loading…
Reference in New Issue
Block a user