New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix possible MusicController nullref #2618
Conversation
If that's the case, shouldn't the The beatmap it's binding to is a |
It's not that the beatmap is null. It's that the beatmap set is null, which happens from testcases that set their own beatmaps. |
The first null coalesce can be removed then. I'd rather fix the testcase instead of this class. BeatmapSet is supposed to be non-null too. As mentioned though, MusicController should be setting a valid beatmap before it loads the component. |
It's not any one testcase. At the moment it's literally every testcase that modifies the beatmap, including but not limited to AllPlayers. Can remove the first null coalesce, sure. But I don't think beatmaps are supposed to always have a beatmap set. The instantiation of a beatmap would be absolutely insane then. |
each testcase that uses a beatmap should set a relevant beatmap on startup, even so. |
You're missing the point of this change. |
This change is still valid. I'm saying on top of this test cases should be specifying valid defaults so order of execution is not an issue. |
Testcases should set defaults that are applicable only to them and those defaults should not be seen by nor have an affect on other testcases. The beatmap is isolated to testcases in my GameBeatmap PR, which follows this principle. |
Because Beatmap bindable can be set by testcases, this is a possibility.
TestCases really need to not change the beatmap bindable but that's a pretty big change.