Skip to content

Commit

Permalink
Using canonical path
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Siebeneicker committed Sep 26, 2020
1 parent e006725 commit b493af9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions DelvEdit/src/com/interrupt/dungeoneer/editor/ui/FilePicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Comparator;
Expand Down Expand Up @@ -285,7 +286,14 @@ public void clicked(InputEvent event, float x, float y) {
}

this.stage = stage;
changeDirectory(new FileHandle(baseDir.file().getAbsoluteFile()));

File file = null;
try {
file = baseDir.file().getCanonicalFile();
} catch (IOException e) {
file = baseDir.file().getAbsoluteFile();
}
changeDirectory(new FileHandle(file));

return super.show(stage);
}
Expand Down Expand Up @@ -345,4 +353,4 @@ protected void result(Object object) {
return pick;
}

}
}

0 comments on commit b493af9

Please sign in to comment.