From 24acb96b395bf5e206171387d2633618cd6e59b6 Mon Sep 17 00:00:00 2001 From: simonspa <1677436+simonspa@users.noreply.github.com> Date: Tue, 7 Jan 2020 23:24:06 +0100 Subject: [PATCH] Trash bin: fix exception triggered if no correct fileId is provided. This fixes #17115 Signed-off-by: Simon Spannagel --- apps/files_trashbin/lib/Controller/PreviewController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/files_trashbin/lib/Controller/PreviewController.php b/apps/files_trashbin/lib/Controller/PreviewController.php index 5f4419b3e5..8708e13308 100644 --- a/apps/files_trashbin/lib/Controller/PreviewController.php +++ b/apps/files_trashbin/lib/Controller/PreviewController.php @@ -84,12 +84,12 @@ class PreviewController extends Controller { * @return DataResponse|Http\FileDisplayResponse */ public function getPreview( - int $fileId, + int $fileId = -1, int $x = 128, int $y = 128 ) { - if ($x === 0 || $y === 0) { + if ($fileId === -1 || $x === 0 || $y === 0) { return new DataResponse([], Http::STATUS_BAD_REQUEST); }