You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user reported an exception when opening the attached file and editing the nose cone.
---------- Exception stack trace ----------
java.lang.NullPointerException: Cannot invoke "info.openrocket.core.aerodynamics.AerodynamicForces.setFrictionCD(double)" because the return value of "java.util.Map.get(Object)" is null
at info.openrocket.core.aerodynamics.BarrowmanCalculator.calculateFrictionCD(BarrowmanCalculator.java:543)
at info.openrocket.core.aerodynamics.BarrowmanCalculator.getForceAnalysis(BarrowmanCalculator.java:116)
at info.openrocket.core.rocketcomponent.RocketComponent.getComponentCD(RocketComponent.java:766)
at info.openrocket.core.rocketcomponent.RocketComponent.getOverrideCD(RocketComponent.java:782)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at info.openrocket.swing.gui.adaptors.DoubleModel.getValue(DoubleModel.java:850)
at info.openrocket.swing.gui.adaptors.DoubleModel$ValueSpinnerModel.getValue(DoubleModel.java:74)
at java.desktop/javax.swing.JSpinner.getValue(JSpinner.java:363)
at java.desktop/javax.swing.JSpinner$DefaultEditor.<init>(JSpinner.java:657)
at java.desktop/javax.swing.JSpinner.createEditor(JSpinner.java:286)
at java.desktop/javax.swing.JSpinner.<init>(JSpinner.java:188)
at info.openrocket.swing.gui.configdialog.RocketComponentConfig.overrideTab(RocketComponentConfig.java:718)
at info.openrocket.swing.gui.configdialog.RocketComponentConfig.<init>(RocketComponentConfig.java:186)
at info.openrocket.swing.gui.configdialog.NoseConeConfig.<init>(NoseConeConfig.java:53)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at info.openrocket.swing.gui.configdialog.ComponentConfigDialog.getDialogContents(ComponentConfigDialog.java:161)
at info.openrocket.swing.gui.configdialog.ComponentConfigDialog.setComponent(ComponentConfigDialog.java:109)
at info.openrocket.swing.gui.configdialog.ComponentConfigDialog.<init>(ComponentConfigDialog.java:62)
at info.openrocket.swing.gui.configdialog.ComponentConfigDialog.showDialog(ComponentConfigDialog.java:269)
at info.openrocket.swing.gui.configdialog.ComponentConfigDialog.showDialog(ComponentConfigDialog.java:301)
at info.openrocket.swing.gui.configdialog.ComponentConfigDialog.showDialog(ComponentConfigDialog.java:313)
at info.openrocket.swing.gui.main.RocketActions$EditAction.editComponents(RocketActions.java:586)
at info.openrocket.swing.gui.main.RocketActions$EditAction.actionPerformed(RocketActions.java:562)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
at java.desktop/java.awt.Component.processEvent(Component.java:6391)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
---------- Thread information ----------
Thread[AWT-EventQueue-0,6,main]
---------- System information ----------
OpenRocket version: 24.12.beta.01
The issue is that the Booster stage is disabled, but its child stage, Booster Set, is not. In calculateForceAnalysis, when a stage is inactive, it ignores all its child components, but here, the child component Booster Set is active (it's sort of overriding its parent stage), and expecting to have values in the forceMap. I see two solutions:
When a stage is disabled, do not allow its child stage to be toggled in the stage selector.
When a stage is disabled, in calculateForceAnalysis check if there are child components that are active, and if so, calculate them.
I think a combination of the two may be appropriate. I don't see why you would want to enable a child stage when its parent is disabled.
Describe the bug
A user reported an exception when opening the attached file and editing the nose cone.
To Reproduce
Screenshots / .ork file
.ork file:
LOC IRIS Modified Blue Tube.ork.zip
OpenRocket version
unstable
What platform are you running on?
macOS
Additional context
No response
The text was updated successfully, but these errors were encountered: