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

ProPurchaseValidationUtils#canUnitsBePlaced:84 - java.lang.NullPointerException #12872

Open
tripleabuilderbot opened this issue Aug 28, 2024 · 3 comments
Labels
2.6 Error Report Issue reported via the in-game error reporter

Comments

@tripleabuilderbot
Copy link
Contributor

User Description

Tried to load the game with the Central Powers as Hard AI and every other nation as human. Error also comes up when any of Neutral_Allied, Neutral_Central, Neutral_Central, Neutral_True, Contested are set to Hard AI.

Map

world_war_i_1914_balanced / World War I 1914 Balanced

TripleA Version

2.6.14780

Java Version

11.0.19

Operating System

Windows 10

Heap Size

2028M

Stack Trace

Exception: java.lang.NullPointerException 
java.lang.Exception
	at games.strategy.triplea.ai.pro.util.ProPurchaseValidationUtils.canUnitsBePlaced(ProPurchaseValidationUtils.java:84)
	at games.strategy.triplea.ai.pro.util.ProPurchaseValidationUtils.lambda$findPurchaseOptionsForTerritory$0(ProPurchaseValidationUtils.java:58)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at games.strategy.triplea.ai.pro.util.ProPurchaseValidationUtils.findPurchaseOptionsForTerritory(ProPurchaseValidationUtils.java:61)
	at games.strategy.triplea.ai.pro.util.ProPurchaseValidationUtils.findPurchaseOptionsForTerritory(ProPurchaseValidationUtils.java:44)
	at games.strategy.triplea.ai.pro.util.ProPurchaseUtils.findMaxPurchaseDefenders(ProPurchaseUtils.java:96)
	at games.strategy.triplea.ai.pro.ProCombatMoveAi.removeAttacksUntilCapitalCanBeHeld(ProCombatMoveAi.java:1789)
	at games.strategy.triplea.ai.pro.ProCombatMoveAi.doCombatMove(ProCombatMoveAi.java:128)
	at games.strategy.triplea.ai.pro.AbstractProAi.purchase(AbstractProAi.java:219)
	at games.strategy.triplea.ai.AbstractAi.start(AbstractAi.java:509)
	at games.strategy.engine.framework.ServerGame.waitForPlayerToFinishStep(ServerGame.java:603)
	at games.strategy.engine.framework.ServerGame.runStep(ServerGame.java:452)
	at games.strategy.engine.framework.ServerGame.runNextStep(ServerGame.java:347)
	at games.strategy.engine.framework.ServerGame.startGame(ServerGame.java:314)
	at games.strategy.engine.framework.startup.launcher.LocalLauncher.launchInternal(LocalLauncher.java:92)
	at games.strategy.engine.framework.startup.launcher.LocalLauncher.lambda$launch$0(LocalLauncher.java:60)
	at java.base/java.lang.Thread.run(Thread.java:829)


@tripleabuilderbot tripleabuilderbot added 2.6 Error Report Issue reported via the in-game error reporter labels Aug 28, 2024
@asvitkine
Copy link
Contributor

Crashing here:

So placeDelegate is null.

@frigoref
Copy link
Member

But what should happen at this point in time if täplaceDelegate is null? Seems a bit too late to properly react to this.

@asvitkine
Copy link
Contributor

Is there a link to the world_war_i_1914_improved map? I only see world_war_i_1914 on github:
https://github.com/triplea-maps/world_war_i_1914/blob/master/games/world_war_i_1914.xml

Probably the map should fail to load if there's a placeDelegate missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.6 Error Report Issue reported via the in-game error reporter
Projects
None yet
Development

No branches or pull requests

3 participants