EA-41985 - AIOOBE: FileColorSettingsTable$ModelAdapter.getValueAt

This commit is contained in:
Sergey Malenkov
2015-03-03 20:06:13 +03:00
parent 22835471b0
commit 66a83f2961
@@ -83,6 +83,7 @@ public abstract class FileColorSettingsTable extends JBTable {
public boolean editCellAt(int row, int column, EventObject e) {
if (e == null || (e instanceof MouseEvent && ((MouseEvent)e).getClickCount() == 1)) return false;
final Object at = getModel().getValueAt(row, column);
if (!(at instanceof FileColorConfiguration)) return false;
final FileColorConfigurationEditDialog dialog = new FileColorConfigurationEditDialog(myManager, ((FileColorConfiguration)at));
dialog.getScopeComboBox().setEnabled(false);
dialog.show();
@@ -190,7 +191,9 @@ public abstract class FileColorSettingsTable extends JBTable {
@Override
public Object getValueAt(int rowIndex, int columnIndex) {
return myConfigurations.get(rowIndex);
return 0 <= rowIndex && rowIndex < myConfigurations.size()
? myConfigurations.get(rowIndex)
: null;
}
@NotNull