Fixed NPE in the Tables panel.

This commit is contained in:
emerald000 2015-04-27 16:52:10 -04:00
parent 5717844297
commit ffaffa39f8

View file

@ -1199,15 +1199,17 @@ class TableTableModel extends AbstractTableModel {
// set the column width from saved value or defaults // set the column width from saved value or defaults
int[] widths = Util.getIntArrayFromString(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_COLUMNS_WIDTH, null)); int[] widths = Util.getIntArrayFromString(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_COLUMNS_WIDTH, null));
int lengthW = widths.length; if (widths != null) {
int i = 0; int lengthW = widths.length;
for (int width : defaultColumnsWidth) { int i = 0;
if (lengthW > i) { for (int width : defaultColumnsWidth) {
width = widths[i]; if (lengthW > i) {
width = widths[i];
}
TableColumn column = table.getColumnModel().getColumn(i++);
column.setWidth(width);
column.setPreferredWidth(width);
} }
TableColumn column = table.getColumnModel().getColumn(i++);
column.setWidth(width);
column.setPreferredWidth(width);
} }
// set the column order // set the column order