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:
parent
265b588035
commit
47a55063e5
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user