-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 NullPointerException on founding a pantheon #10888
Fix NullPointerException on founding a pantheon #10888
Conversation
Must have been a regression by #10877 - please cross-check? |
@SomeTroglodyte Sorry, what does "cross-check" mean? |
It means please read that PR, and check if it indeed broke this, and if it did why and whether its intention is preserved by this. |
Thank you! Yes, the
Prior to #10877, that comment line was immediately below the block that creates the I've fiddled with https://github.com/yairm210/Unciv/blob/master/core/src/com/unciv/logic/civilization/managers/ReligionManager.kt#L390 for purely textual symmetry, making all three clauses in the |
Uh, haven't got the energy to Guess intentions - Xander's originally or @SeventhM 's. I got to that comment you showed, and the conclusion the original author (guessing all of that must have been xlenstra - not |
@SeventhM This branch moves the
down to https://github.com/yairm210/Unciv/blob/master/core/src/com/unciv/logic/civilization/managers/ReligionManager.kt#L390, same as the other two clauses in the This deletes those lines from the Does this preserve the intent of #10877? |
core/src/com/unciv/logic/civilization/managers/ReligionManager.kt
Outdated
Show resolved
Hide resolved
Also, something tells me foundPantheon should also be in the pantheon picker screen now that I think about it, not just here. Can't believe I overlooked it, especially when it took needed it's triggers moved |
Release patch |
Reopening because we get a lot of these |
Oh whoops this needs to be on an issue |
Unciv crashes at https://github.com/yairm210/Unciv/blob/master/core/src/com/unciv/logic/civilization/managers/ReligionManager.kt#L378 because
religion
is needed to be non-null and is null (because it has not yet been created).Maybe setting
ReligionState
needs to be down at https://github.com/yairm210/Unciv/blob/master/core/src/com/unciv/logic/civilization/managers/ReligionManager.kt#L390, I don't know, I don't really follow the logic there. But I thinkfoundPantheon
needs to happen beforereligion
is used, because that's what makesreligion
non-null.This branch makes the
NullPointerException
not happen.