Better exception handling
This commit is contained in:
parent
688ccc9b45
commit
78f1ee3a94
@ -375,6 +375,9 @@ public class Rocket extends ComponentAssembly {
|
|||||||
copyRocket.stageMap = new ConcurrentHashMap<>();
|
copyRocket.stageMap = new ConcurrentHashMap<>();
|
||||||
for( Map.Entry<Integer,AxialStage> entry : this.stageMap.entrySet()){
|
for( Map.Entry<Integer,AxialStage> entry : this.stageMap.entrySet()){
|
||||||
final AxialStage stage = (AxialStage)copyRocket.findComponent(entry.getValue().getID());
|
final AxialStage stage = (AxialStage)copyRocket.findComponent(entry.getValue().getID());
|
||||||
|
if (stage == null) {
|
||||||
|
throw new IllegalStateException("Stage not found in copy");
|
||||||
|
}
|
||||||
copyRocket.stageMap.put(entry.getKey(), stage);
|
copyRocket.stageMap.put(entry.getKey(), stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user