From ebc5571f301b97ea18675040294eb335786c6a70 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 8 Mar 2020 22:05:04 +0100 Subject: [PATCH] Fix exception when creating a new library --- src/main/java/org/jabref/gui/BasePanel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/BasePanel.java b/src/main/java/org/jabref/gui/BasePanel.java index 65bfb60f56a..835ee0fa07a 100644 --- a/src/main/java/org/jabref/gui/BasePanel.java +++ b/src/main/java/org/jabref/gui/BasePanel.java @@ -504,7 +504,9 @@ public void clearAndSelect(final BibEntry bibEntry) { */ private void clearAndSelectFirst() { mainTable.clearAndSelectFirst(); - showAndEdit(mainTable.getSelectedEntries().get(0)); + if (!mainTable.getSelectedEntries().isEmpty()) { + showAndEdit(mainTable.getSelectedEntries().get(0)); + } } public void selectPreviousEntry() {