diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 0fa52f5fc..000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1625095153807 - - \ No newline at end of file diff --git a/core/src/net/sf/openrocket/rocketcomponent/Rocket.java b/core/src/net/sf/openrocket/rocketcomponent/Rocket.java index 513f16391..413e99b23 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/Rocket.java +++ b/core/src/net/sf/openrocket/rocketcomponent/Rocket.java @@ -375,6 +375,9 @@ public class Rocket extends ComponentAssembly { copyRocket.stageMap = new ConcurrentHashMap<>(); for( Map.Entry entry : this.stageMap.entrySet()){ 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); } diff --git a/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java b/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java index 01b5b6820..b4a4b91e2 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java +++ b/core/src/net/sf/openrocket/rocketcomponent/RocketComponent.java @@ -408,7 +408,8 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab checkState(); RocketComponent clone; try { - clone = (RocketComponent) this.clone(); + clone = this.clone(); + clone.id = this.id; } catch (CloneNotSupportedException e) { throw new BugException("CloneNotSupportedException encountered, report a bug!", e); }