Skip to content

Commit 073b792

Browse files
Merge pull request #47625 from nextcloud/backport/47581/stable30
[stable30] fix: Do not fail to get internal path on NonExistingFile
2 parents a484760 + 2e312e4 commit 073b792

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

lib/private/Files/Node/NonExistingFile.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ public function getId() {
3838
}
3939
}
4040

41+
public function getInternalPath() {
42+
if ($this->fileInfo) {
43+
return parent::getInternalPath();
44+
} else {
45+
return $this->getParent()->getMountPoint()->getInternalPath($this->getPath());
46+
}
47+
}
48+
4149
public function stat() {
4250
throw new NotFoundException();
4351
}

lib/private/Files/Node/NonExistingFolder.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ public function getId() {
3838
}
3939
}
4040

41+
public function getInternalPath() {
42+
if ($this->fileInfo) {
43+
return parent::getInternalPath();
44+
} else {
45+
return $this->getParent()->getMountPoint()->getInternalPath($this->getPath());
46+
}
47+
}
48+
4149
public function stat() {
4250
throw new NotFoundException();
4351
}

0 commit comments

Comments
 (0)