Skip to content

[BUG] Uncaught exception in MpEntitlementChecker when requesting old versions of BeatSaver maps #17

@rcelyte

Description

@rcelyte

MultiplayerCore Version
1.0.0

Your Platform
PC

Describe the bug
MpEntitlementChecker runs Enumerable.First() on the response received from BeatSaver, which throws instead of being handled gracefully if the requested hash isn't found. Such is the case with levels that have been revised after upload.

To Reproduce

  1. Request attached beatmap
  2. Observe other clients who don't have the song failing to respond to the entitlement check

Log

InvalidOperationException: Sequence contains no matching element
System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
MultiplayerCore.Objects.MpEntitlementChecker+<>c__DisplayClass13_0.<GetEntitlementStatus>b__0 (System.Threading.Tasks.Task`1[TResult] r) (at <ca5fd0a0d2364fa38cb3ebaefaa816a1>:0)
System.Threading.Tasks.ContinuationResultTaskFromResultTask`2[TAntecedentResult,TResult].InnerInvoke () (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Threading.Tasks.Task.Execute () (at <eae584ce26bc40229c1b1aa476bfa589>:0)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions