Skip to content

Fix: NPE when Espionage Screen is used to move a spy and the Civs don't know each other#14786

Open
SomeTroglodyte wants to merge 2 commits intoyairm210:masterfrom
SomeTroglodyte:Fix14749
Open

Fix: NPE when Espionage Screen is used to move a spy and the Civs don't know each other#14786
SomeTroglodyte wants to merge 2 commits intoyairm210:masterfrom
SomeTroglodyte:Fix14749

Conversation

@SomeTroglodyte
Copy link
Copy Markdown
Collaborator

@SomeTroglodyte SomeTroglodyte commented Apr 28, 2026

Regression from #14749
Fixes #14782

Raises the question - should we not suppress listing cities that the player has no knowledge of?

Edit: Raises another question - Tech Satellites should prevent the bug from triggering in the specific circumstances the issue names - starting in the future era. Sounds like a bug that triggers won't trigger properly when the gamestarter adds the techs.

Edit: Not kicking off a patch, despite the cause being deterministic - I'm estimating the conditions to be rare enough. I may be wrong.

Copy link
Copy Markdown
Owner

@yairm210 yairm210 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that if techs aren't triggering properly when starting from era there is another bug, but this one seems pretty straightforward

@SomeTroglodyte
Copy link
Copy Markdown
Collaborator Author

Agree that if techs aren't triggering properly when starting from era there is another bug, but this one seems pretty straightforward

Exactly.

FYI, I've also checked whether a fun DiplomacyManager?.hasFlag(flag: DiplomacyFlags) = this?.hasFlag(flag) == true extension would make sense, so one could always call hasFlag directly on the result of getDiplomacyManager and get a valid answer, but I checked about half of the 32 occurrences of !!.hasFlag and found no place where the !! wasn't covered in some way, or where using that extension would significantly reduce code or improve readability = not worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An unrecoverable error has occurred in Unciv

2 participants