Skip to content

Commit 8e4a5cc

Browse files
committed
fix(psalm): undefined interface methods
Signed-off-by: Elizabeth Danzberger <[email protected]>
1 parent 4c0d5f4 commit 8e4a5cc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/Controller/DocumentController.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function remote(string $shareToken, string $remoteServer, string $remoteS
256256
}
257257

258258
$node = $share->getNode();
259-
if ($filePath !== null) {
259+
if ($filePath !== null && $node instanceof Folder) {
260260
$node = $node->get($filePath);
261261
}
262262

@@ -484,10 +484,8 @@ private function getFileForShare(IShare $share, ?int $fileId, ?string $path = nu
484484
throw new NotFoundException();
485485
}
486486

487-
if ($path !== null) {
488-
$node = $node->get($path);
489-
} else {
490-
$node = $node->getFirstNodeById($fileId);
487+
if ($node instanceof Folder) {
488+
$node = ($path !== null) ? $node->get($path) : $node->getFirstNodeById($fileId);
491489
}
492490

493491
if ($node instanceof File) {

0 commit comments

Comments
 (0)