From 41a1999f82d06a36cdfef70bb77f963e2a1ff6d5 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 4 Sep 2022 20:12:28 +0200 Subject: [PATCH] Fix issue with empty fallback directory (#9134) --- src/main/java/org/jabref/preferences/JabRefPreferences.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index ef7f129a320..496e4face75 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -2171,11 +2171,11 @@ public FieldWriterPreferences getFieldWriterPreferences() { * @param originalDirectory the directory as configured */ private String determineMainFileDirectory(String originalDirectory) { - if (!originalDirectory.isEmpty()) { + if ((originalDirectory != null) && !originalDirectory.isEmpty()) { // A non-empty directory is kept return originalDirectory; } - return Path.of(JabRefDesktop.getDefaultFileChooserDirectory(), "JabRef").toString(); + return JabRefDesktop.getDefaultFileChooserDirectory().toString(); } @Override