From cbef5a6335cc708b901c83be0222b4e865132bab Mon Sep 17 00:00:00 2001 From: grimes2 Date: Sat, 27 Aug 2016 14:26:58 +0200 Subject: [PATCH] Error setting field freeze (#1863) * Error setting field freeze * Update EntryEditor.java * Background color * Typo * Another Typo * color before if * CHANGELOG edited --- CHANGELOG.md | 1 + .../java/net/sf/jabref/gui/entryeditor/EntryEditor.java | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55d463217b5..b6039538cf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# ### Fixed - Fixed NullPointerException when opening search result window for an untitled database +- Fixed #1757: Crash after saving illegal argument in entry editor ### Removed - The non-supported feature of being able to define file directories for any extension is removed. Still, it should work for older databases using the legacy `ps` and `pdf` fields, although we strongly encourage using the `file` field. diff --git a/src/main/java/net/sf/jabref/gui/entryeditor/EntryEditor.java b/src/main/java/net/sf/jabref/gui/entryeditor/EntryEditor.java index efabcfbdc0c..fa39d7f3d0d 100644 --- a/src/main/java/net/sf/jabref/gui/entryeditor/EntryEditor.java +++ b/src/main/java/net/sf/jabref/gui/entryeditor/EntryEditor.java @@ -1208,10 +1208,12 @@ public void actionPerformed(ActionEvent event) { updateSource(); panel.markBaseChanged(); } catch (IllegalArgumentException ex) { - JOptionPane.showMessageDialog(frame, Localization.lang("Error") + ": " + ex.getMessage(), - Localization.lang("Error setting field"), JOptionPane.ERROR_MESSAGE); fieldEditor.setInvalidBackgroundColor(); - LOGGER.debug("Error setting field", ex); + if (!SwingUtilities.isEventDispatchThread()) { + JOptionPane.showMessageDialog(frame, Localization.lang("Error") + ": " + ex.getMessage(), + Localization.lang("Error setting field"), JOptionPane.ERROR_MESSAGE); + LOGGER.debug("Error setting field", ex); + } } } else { // set == false