Skip to content
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 NPE with loaded save games from past versions. #11783

Merged
merged 2 commits into from
Jul 16, 2023

Commits on Jul 15, 2023

  1. Fix NPE with loaded save games from past versions.

    The issue is that old saved games may save references to the GamePlayer on various objects, including pending battles.
    
    Since 2.6 has an invariant that all GamePlayer objects have a non-null getData(), which was not true in 2.5 and earlier, we need to update these after loading the game. In particular, we need to fix up all references to the null player with the instance from the game data.
    
    This was already being done for units and territories via GameData::fixUpNullPlayers(). This adds it also for pending battles.
    asvitkine committed Jul 15, 2023
    Configuration menu
    Copy the full SHA
    f57c9b0 View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2023

  1. Fix tests.

    asvitkine committed Jul 16, 2023
    Configuration menu
    Copy the full SHA
    6fb5767 View commit details
    Browse the repository at this point in the history