summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Controller
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-10-08 16:42:22 +0200
committerRobin Appelman <robin@icewind.nl>2018-10-17 14:57:37 +0200
commitf5a41e2e15dc0b1a245dccd569a5123ec87e2a1e (patch)
tree36d7b16508b70576cca59ee86d5c54899ae83a1b /apps/files_trashbin/lib/Controller
parent6c5ea0cecaa2dc21cfb6fc9ea339f8bae7d2a986 (diff)
downloadnextcloud-server-f5a41e2e15dc0b1a245dccd569a5123ec87e2a1e.tar.gz
nextcloud-server-f5a41e2e15dc0b1a245dccd569a5123ec87e2a1e.zip
fix error message for folder preview request
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_trashbin/lib/Controller')
-rw-r--r--apps/files_trashbin/lib/Controller/PreviewController.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_trashbin/lib/Controller/PreviewController.php b/apps/files_trashbin/lib/Controller/PreviewController.php
index 59c4e508154..f79e19a463e 100644
--- a/apps/files_trashbin/lib/Controller/PreviewController.php
+++ b/apps/files_trashbin/lib/Controller/PreviewController.php
@@ -30,15 +30,12 @@ use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\Files\File;
-use OCP\Files\FileInfo;
use OCP\Files\Folder;
use OCP\Files\IMimeTypeDetector;
use OCP\Files\IRootFolder;
use OCP\Files\NotFoundException;
use OCP\IPreview;
use OCP\IRequest;
-use OCP\IUser;
use OCP\IUserSession;
class PreviewController extends Controller {
@@ -98,9 +95,12 @@ class PreviewController extends Controller {
try {
$file = $this->trashManager->getTrashNodeById($this->userSession->getUser(), $fileId);
- if ($file === null || $file instanceof Folder) {
+ if ($file === null) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
}
+ if ($file instanceof Folder) {
+ return new DataResponse([], Http::STATUS_BAD_REQUEST);
+ }
$pathParts = pathinfo($file->getName());
$extension = $pathParts['extension'];