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:
commit
b8748a86c5
@ -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; }
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user