summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Controller/PreviewController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin/lib/Controller/PreviewController.php')
-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'];