Trash bin: fix exception triggered if no correct fileId is provided.

This fixes #17115

Signed-off-by: Simon Spannagel <simon.spannagel@cern.ch>
This commit is contained in:
simonspa 2020-01-07 23:24:06 +01:00 committed by Simon Spannagel
parent 86bccde9c7
commit b3ad27f7db
1 changed files with 2 additions and 2 deletions

View File

@ -88,12 +88,12 @@ class PreviewController extends Controller {
* @return DataResponse|Http\FileDisplayResponse * @return DataResponse|Http\FileDisplayResponse
*/ */
public function getPreview( public function getPreview(
int $fileId, int $fileId = -1,
int $x = 128, int $x = 128,
int $y = 128 int $y = 128
) { ) {
if ($x === 0 || $y === 0) { if ($fileId === -1 || $x === 0 || $y === 0) {
return new DataResponse([], Http::STATUS_BAD_REQUEST); return new DataResponse([], Http::STATUS_BAD_REQUEST);
} }