Skip to content

Commit

Permalink
Use getProTerritory() to avoid NPE.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvitkine committed Jul 6, 2023
1 parent 6711573 commit 14d40c0
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,8 @@ public boolean visit(Territory t, int distance) {
if (finalDestinationTest.test(t)) {
Route r = data.getMap().getRouteForUnit(from, t, canMoveThrough, unit, player);
while (r != null && r.hasSteps()) {
if (moveMap.get(r.getEnd()).isCanHold() && validateMove.test(r)) {
final ProTerritory proDestination = proData.getProTerritory(moveMap, r.getEnd());
if (proDestination.isCanHold() && validateMove.test(r)) {
destination.setValue(r.getEnd());
// End the search.
return false;
Expand Down

0 comments on commit 14d40c0

Please sign in to comment.