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