Skip to content

Commit

Permalink
Fix a rare NPE.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvitkine committed Sep 13, 2023
1 parent 96f1679 commit 27e7dca
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ protected void perform(final GameState data) {
newTotalDamage.forEach(
(unitId, damage) -> {
final Unit unit = data.getUnits().get(UUID.fromString(unitId));
unit.setHits(damage);
if (unit != null) {
unit.setHits(damage);
}
});
// invoke territory change listeners
for (final String territory : territoriesToNotify) {
Expand Down

0 comments on commit 27e7dca

Please sign in to comment.