Skip to content

Commit 3feab27

Browse files
author
bytekeeper
committed
Instead of ignoring exceptions, don't throw them.
1 parent e93646f commit 3feab27

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/main/java/bwem/map/Map.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,7 @@ public void onUnitDestroyed(Unit u) {
142142
if (u.getType().isMineralField()) {
143143
onMineralDestroyed(u);
144144
} else {
145-
try {
146-
onStaticBuildingDestroyed(u);
147-
} catch (Exception ex) {
148-
// TODO: Handle this exception appropriately.
149-
/**
150-
* An exception WILL be thrown if the unit is not in the "Map.StaticBuildings" list. Just
151-
* ignore the exception.
152-
*/
153-
}
145+
onStaticBuildingDestroyed(u);
154146
}
155147
}
156148

@@ -187,7 +179,6 @@ private void onStaticBuildingDestroyed(Unit u) {
187179
return;
188180
}
189181
}
190-
throw new IllegalArgumentException("unit is not a StaticBuilding");
191182
}
192183

193184
public List<Area> getAreas() {

0 commit comments

Comments
 (0)