diff --git a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogViewModel.java b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogViewModel.java index 954c53a84b3..c360fe6e90f 100644 --- a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogViewModel.java +++ b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogViewModel.java @@ -119,6 +119,10 @@ void checkForBadFileNameAndAdd(Path fileToAdd) { dialogService.showErrorDialogAndWait(ex); } } + } else { + link.set(relativize(fileToAdd)); + filePreferences.setWorkingDirectory(fileToAdd); + setExternalFileTypeByExtension(link.getValueSafe()); } }