Skip to content

Commit

Permalink
Fix a rare NPE. (#11955)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvitkine authored Sep 13, 2023
1 parent a0ee71b commit 12fdfda
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 12fdfda

Please sign in to comment.