Updates for 0.9.5
[debian/openrocket] / src / net / sf / openrocket / gui / adaptors / MotorConfigurationModel.java
index 92e8473948e0f5aa6214d40f928e359078b2d615..5c01348747136b6b51432686772c313d490a34de 100644 (file)
@@ -63,6 +63,10 @@ public class MotorConfigurationModel implements ComboBoxModel, ChangeListener {
 
        @Override
        public void setSelectedItem(Object item) {
+               if (item == null) {
+                       // Clear selection - huh?
+                       return;
+               }
                if (item == EDIT) {
                        
                        // Open edit dialog in the future, after combo box has closed
@@ -76,8 +80,9 @@ public class MotorConfigurationModel implements ComboBoxModel, ChangeListener {
 
                        return;
                }
-               if (!(item instanceof ID))
-                       return;
+               if (!(item instanceof ID)) {
+                       throw new IllegalArgumentException("MotorConfigurationModel item="+item);
+               }
                
                ID idObject = (ID) item;
                config.setMotorConfigurationID(idObject.getID());