Skip to content

Commit 2e86293

Browse files
Merge pull request #58428 from nextcloud/backport/58112/stable31
[stable31] fix(TaskProcessing): Refactor TextToImage fallback
2 parents 9851792 + 990a0c6 commit 2e86293

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/private/TaskProcessing/Manager.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,16 @@ public function process(?string $userId, array $input, callable $reportProgress)
330330
} catch (\OCP\Files\NotFoundException) {
331331
$folder = $this->appData->newFolder('text2image');
332332
}
333+
if ($input['numberOfImages'] > 12) {
334+
throw new ProcessingException(
335+
'numberOfImages cannot be greater than 12'
336+
);
337+
}
338+
if ($input['numberOfImages'] < 1) {
339+
throw new ProcessingException(
340+
'numberOfImages must be greater than 0'
341+
);
342+
}
333343
$resources = [];
334344
$files = [];
335345
for ($i = 0; $i < $input['numberOfImages']; $i++) {

0 commit comments

Comments
 (0)