aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/PreviewController.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Controller/PreviewController.php')
-rw-r--r--core/Controller/PreviewController.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/Controller/PreviewController.php b/core/Controller/PreviewController.php
index 34c21bd3ecb..7ab22dceaa2 100644
--- a/core/Controller/PreviewController.php
+++ b/core/Controller/PreviewController.php
@@ -133,14 +133,12 @@ class PreviewController extends Controller {
}
$userFolder = $this->root->getUserFolder($this->userId);
- $nodes = $userFolder->getById($fileId);
+ $node = $userFolder->getFirstNodeById($fileId);
- if (\count($nodes) === 0) {
+ if (!$node) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
}
- $node = array_pop($nodes);
-
return $this->fetchPreview($node, $x, $y, $a, $forceIcon, $mode, $mimeFallback);
}