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

Handle nulls and fix missing documentation

This commit is contained in:
Dean Herbert 2021-07-05 21:30:24 +09:00
parent 77adf687c6
commit 459f9a0465
3 changed files with 9 additions and 1 deletions

View File

@ -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>>();

View File

@ -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);

View File

@ -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);