Fix resolving non existant files in the root directory
This commit is contained in:
parent
7c76b5ca1a
commit
508676d9bd
1 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,6 @@ public class JsVm {
|
||||||
for (int i = 0; i < splitPath.size(); i++) {
|
for (int i = 0; i < splitPath.size(); i++) {
|
||||||
var segment = splitPath.get(i);
|
var segment = splitPath.get(i);
|
||||||
var child = node.listing().get(segment);
|
var child = node.listing().get(segment);
|
||||||
if (child == null) return null;
|
|
||||||
if (child instanceof AjarSymlinkFile symlink) {
|
if (child instanceof AjarSymlinkFile symlink) {
|
||||||
// TODO: symlink infinite recursion protection
|
// TODO: symlink infinite recursion protection
|
||||||
if (symlink.target().startsWith("/")) {
|
if (symlink.target().startsWith("/")) {
|
||||||
|
@ -86,6 +85,7 @@ public class JsVm {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i == splitPath.size() - 1) break;
|
if (i == splitPath.size() - 1) break;
|
||||||
|
if (child == null) return null;
|
||||||
if (!(child instanceof AjarDirectory directory)) {
|
if (!(child instanceof AjarDirectory directory)) {
|
||||||
throw new RuntimeException("No such file or directory " + path);
|
throw new RuntimeException("No such file or directory " + path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue