summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-01-08 09:11:02 +0100
committerGitHub <noreply@github.com>2020-01-08 09:11:02 +0100
commitada25ab461e3ec728357fac0e96664c39daf1902 (patch)
tree165d531d5f064e514192b09fccffd136620c7a8c
parente645c5d96a0431653599e4510ae0e827bd10af2e (diff)
parentb3ad27f7dbec28c1a418f572906618ae10506972 (diff)
downloadnextcloud-server-ada25ab461e3ec728357fac0e96664c39daf1902.tar.gz
nextcloud-server-ada25ab461e3ec728357fac0e96664c39daf1902.zip
Merge pull request #18728 from simonspa/trashbin_exception
Trash bin: fix exception triggered if no correct fileId is provided.
-rw-r--r--apps/files_trashbin/lib/Controller/PreviewController.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/files_trashbin/lib/Controller/PreviewController.php b/apps/files_trashbin/lib/Controller/PreviewController.php
index 86789714057..a734454bd50 100644
--- a/apps/files_trashbin/lib/Controller/PreviewController.php
+++ b/apps/files_trashbin/lib/Controller/PreviewController.php
@@ -88,12 +88,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);
}