Closed peppy closed 3 years ago
Taking #11304 as an example, it appears that someone has joined the room with nonexistent/no-longer-existing user ID, causing everyone's clients inside that room to crash due to thinking that the ID exists then fetching it and using it without checks.
request for User
by the nonexistent user ID, probably came from the await PopulateUser(user)
call inside UserJoined
:
2020-12-25 07:48:20 [verbose]: Performing request osu.Game.Online.API.Requests.GetUsersRequest
2020-12-25 07:48:20 [verbose]: Request to https://osu.ppy.sh/api/v2/users/?ids[]=12814551 successfully completed!
leading to ParticipantPanel
using the null result User
after being set to MultiplayerRoomUser
:
2020-12-25 07:48:20 [verbose]: Unhandled exception has been allowed with 0 more allowable exceptions .
2020-12-25 07:48:20 [error]: An unhandled error has occurred.
2020-12-25 07:48:20 [error]: System.NullReferenceException: Object reference not set to an instance of an object.
2020-12-25 07:48:20 [error]: at osu.Game.Screens.Multi.RealtimeMultiplayer.Participants.ParticipantPanel.load()
2020-12-25 07:48:20 [error]: --- End of stack trace from previous location where exception was thrown ---
2020-12-25 07:48:20 [error]: at osu.Framework.Allocation.BackgroundDependencyLoaderAttribute.<>c__DisplayClass6_0.<CreateActivator>b__4(Object target, IReadOnlyDependencyContainer dc)
2020-12-25 07:48:20 [error]: at osu.Framework.Allocation.DependencyActivator.activate(Object obj, IReadOnlyDependencyContainer dependencies)
...
It's unlikely that the user really joined with a nonexistent ID, maybe it got deleted during the join request. Client should probably check for null User
s and not attempt to add them, or handle that server-side from the database or otherwise.
This was a restricted user. Needs to be handled server side (disallow outwards propagating events) and client side (fallback to showing an "unknown user" card or similar).
Will do the client-side handling.
Reproduced while sitting in a room as they played.