Fix crash on attempting to edit particular beatmaps #29534
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix crash on attempting to edit particular beatmaps
Closes #29492.
I'm not immediately sure why this happened, but some old locally modified beatmaps in my local realm database have a
BeatDivisor
of 0 stored, which is then passed toBindableBeatDivisor.SetArbitraryDivisor()
, which then blows up.To stop this from happening, just refuse to use values outside of a sane range.
Clamp beat divisor to sane range when decoding
In my view this is a nice change, but do note that on its own it does nothing to fix #29492, because of
BeatmapInfo
reference management foibles when opening the editor. See also: #20883 (comment), #28473.