From 315445464a2ed72562d3ccf326d954b7f388f975 Mon Sep 17 00:00:00 2001 From: asvitkine Date: Tue, 25 Jul 2023 00:50:36 -0400 Subject: [PATCH] Don't show produces 0xPUs tooltip. (#11814) --- .../strategy/triplea/attachments/UnitAttachment.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/UnitAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/UnitAttachment.java index cf71be397d7..bc2a29f2292 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/UnitAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/UnitAttachment.java @@ -3468,10 +3468,14 @@ private static void addIntegerMapDescription( sb.append(integerMap.totalValues()); } else { for (final Entry entry : integerMap.entrySet()) { - sb.append(entry.getValue()).append("x").append(entry.getKey().getName()).append(" "); + if (entry.getValue() != 0) { + sb.append(entry.getValue()).append("x").append(entry.getKey().getName()).append(" "); + } } } - formatter.append(key, sb.toString()); + if (sb.length() > 0) { + formatter.append(key, sb.toString()); + } } }