When the OK button in the component preset dialog is pressed without selecting an...
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Wed, 29 Aug 2012 13:48:32 +0000 (13:48 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Wed, 29 Aug 2012 13:48:32 +0000 (13:48 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@1007 180e2498-e6e9-4542-8430-84ac67f01cd8

core/src/net/sf/openrocket/gui/dialogs/preset/ComponentPresetChooserDialog.java

index 8f5b1bbbf8268649cafeba913d6232839af7d40e..9efa3675e7a789c022b9ccfc809516ba02b46d41 100644 (file)
@@ -238,6 +238,10 @@ public class ComponentPresetChooserDialog extends JDialog {
                if (!okClicked)
                        return null;
                int row = componentSelectionTable.getSelectedRow();
+               if ( row < 0 ) {
+                       // Nothing selected.
+                       return null;
+               }
                row = componentSelectionTable.convertRowIndexToModel(row);
                return presets.get(row);
        }