1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:07:25 +08:00

Merge pull request #14204 from peppy/fix-null-ref-online-tracking-component

Fix potential null reference in online status resolution in multiplayer match
This commit is contained in:
Dan Balasescu 2021-08-10 18:36:13 +09:00 committed by GitHub
commit b8748a86c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -13,8 +13,16 @@ namespace osu.Game.Database
public interface IModelManager<TModel>
where TModel : class
{
/// <summary>
/// A bindable which contains a weak reference to the last item that was updated.
/// This is not thread-safe and should be scheduled locally if consumed from a drawable component.
/// </summary>
IBindable<WeakReference<TModel>> ItemUpdated { get; }
/// <summary>
/// A bindable which contains a weak reference to the last item that was removed.
/// This is not thread-safe and should be scheduled locally if consumed from a drawable component.
/// </summary>
IBindable<WeakReference<TModel>> ItemRemoved { get; }
}
}

View File

@ -59,8 +59,8 @@ namespace osu.Game.Online.Rooms
protected override bool VerifyDatabasedModel(BeatmapSetInfo databasedSet)
{
int? beatmapId = SelectedItem.Value.Beatmap.Value.OnlineBeatmapID;
string checksum = SelectedItem.Value.Beatmap.Value.MD5Hash;
int? beatmapId = SelectedItem.Value?.Beatmap.Value.OnlineBeatmapID;
string checksum = SelectedItem.Value?.Beatmap.Value.MD5Hash;
var matchingBeatmap = databasedSet.Beatmaps.FirstOrDefault(b => b.OnlineBeatmapID == beatmapId && b.MD5Hash == checksum);