From 23e9e523e36705fd2562c300e4fc7bc73f7ac8c5 Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 23 Apr 2019 18:49:11 +0200 Subject: [PATCH] Quick fix for error when opening preferences (#4917) --- src/main/java/org/jabref/gui/preferences/TableColumnsTab.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/jabref/gui/preferences/TableColumnsTab.java b/src/main/java/org/jabref/gui/preferences/TableColumnsTab.java index 18049b23385..7f5d8ba1198 100644 --- a/src/main/java/org/jabref/gui/preferences/TableColumnsTab.java +++ b/src/main/java/org/jabref/gui/preferences/TableColumnsTab.java @@ -316,6 +316,9 @@ public void setValues() { if (extraFileColumns.isSelected()) { List desiredColumns = prefs.getStringList(JabRefPreferences.LIST_OF_FILE_COLUMNS); int listSize = listOfFileColumns.getSelectionModel().getSelectedIndex(); + if (listSize < 0) { + listSize = 0; + } int[] indicesToSelect = new int[listSize]; for (int i = 0; i < listSize; i++) { indicesToSelect[i] = listSize + 1;