Skip to content

Commit eeec031

Browse files
Merge pull request #58534 from nextcloud/backport/58112/stable30-next-version3
[stable30] Fix(TaskProcessing): Refactor TextToImage fallback
2 parents 45cf1db + a6b4bf0 commit eeec031

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
@@ -320,6 +320,16 @@ public function process(?string $userId, array $input, callable $reportProgress)
320320
} catch (\OCP\Files\NotFoundException) {
321321
$folder = $this->appData->newFolder('text2image');
322322
}
323+
if ($input['numberOfImages'] > 12) {
324+
throw new ProcessingException(
325+
'numberOfImages cannot be greater than 12'
326+
);
327+
}
328+
if ($input['numberOfImages'] < 1) {
329+
throw new ProcessingException(
330+
'numberOfImages must be greater than 0'
331+
);
332+
}
323333
$resources = [];
324334
$files = [];
325335
for ($i = 0; $i < $input['numberOfImages']; $i++) {

0 commit comments

Comments
 (0)