Skip to content

Commit

Permalink
prevent null reference error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras committed Jan 15, 2024
1 parent 6d4f78e commit ae21f7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rc_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,8 @@ static void rc_client_invalidate_memref_leaderboards(rc_client_game_info_t* game
for (; leaderboard < stop; ++leaderboard) {
if (leaderboard->public_.state == RC_CLIENT_LEADERBOARD_STATE_DISABLED)
continue;
if (!leaderboard->lboard)
continue;

if (rc_trigger_contains_memref(&leaderboard->lboard->start, memref))
leaderboard->public_.state = RC_CLIENT_LEADERBOARD_STATE_DISABLED;
Expand All @@ -1033,8 +1035,7 @@ static void rc_client_invalidate_memref_leaderboards(rc_client_game_info_t* game
else
continue;

if (leaderboard->lboard)
leaderboard->lboard->state = RC_LBOARD_STATE_DISABLED;
leaderboard->lboard->state = RC_LBOARD_STATE_DISABLED;

RC_CLIENT_LOG_WARN_FORMATTED(client, "Disabled leaderboard %u. Invalid address %06X", leaderboard->public_.id, memref->address);
}
Expand Down

0 comments on commit ae21f7c

Please sign in to comment.