When the OK button in the component preset dialog is pressed without selecting an item, don't change the current preset for the component. This was reported as an IndexOutOfBounds exception.

This commit is contained in:
Kevin Ruland 2012-08-29 13:48:32 +00:00
parent 265b588035
commit 47a55063e5

View 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);
}