Skip to content

Commit 2d4f516

Browse files
committed
roundtrip for absolute/relative
1 parent cdc9822 commit 2d4f516

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jabgui/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesViewModel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ public void togglePath(StringProperty fileDirectory) {
271271
if (!currPath.isAbsolute()) {
272272
newPath = parentPath.resolve(fileDirectory.get()).toAbsolutePath().toString();
273273
} else if (currPath.isAbsolute()) {
274-
newPath = parentPath.relativize(currPath).toString();
274+
Path rel = parentPath.relativize(currPath);
275+
newPath = rel.toString().isEmpty() ? "." : rel.toString();
275276
} else {
276277
// case: convert to relative path and currPath is relative
277278
return;

0 commit comments

Comments
 (0)