diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index afaa723c20039..8e1d4e4972472 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -330,6 +330,16 @@ public function process(?string $userId, array $input, callable $reportProgress) } catch (\OCP\Files\NotFoundException) { $folder = $this->appData->newFolder('text2image'); } + if ($input['numberOfImages'] > 12) { + throw new ProcessingException( + 'numberOfImages cannot be greater than 12' + ); + } + if ($input['numberOfImages'] < 1) { + throw new ProcessingException( + 'numberOfImages must be greater than 0' + ); + } $resources = []; $files = []; for ($i = 0; $i < $input['numberOfImages']; $i++) {