Skip to content

Commit

Permalink
More null safety
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernthedev committed Jul 27, 2024
1 parent fa5eb45 commit da10a12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Hooks/FakeNotes/BeatmapData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ template <typename U, typename T> auto FakeCount(ArrayW<T> list, bool v2) {
MAKE_HOOK_MATCH(V2_BeatmapDataLoader_GetBeatmapDataBasicInfoFromSaveDataJson,
&BeatmapDataLoaderVersion2_6_0AndEarlier::BeatmapDataLoader::GetBeatmapDataBasicInfoFromSaveDataJson,
GlobalNamespace::BeatmapDataBasicInfo*, StringW beatmapSaveDataJson) {
if (!beatmapSaveDataJson) return nullptr;
if (!beatmapSaveDataJson) return V2_BeatmapDataLoader_GetBeatmapDataBasicInfoFromSaveDataJson(beatmapSaveDataJson);

auto beatmapSaveData =
JsonUtility::FromJson<BeatmapSaveDataVersion2_6_0AndEarlier::BeatmapSaveData*>(beatmapSaveDataJson);
if (beatmapSaveData == nullptr) {
if (beatmapSaveData == nullptr || beatmapSaveData->notes == nullptr) {
return nullptr;
}
ListW<BeatmapSaveDataVersion2_6_0AndEarlier::NoteData*> notes = beatmapSaveData->notes;
Expand Down

0 comments on commit da10a12

Please # to comment.