aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-10-23 13:16:37 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-10-23 13:16:37 +0200
commit4b8a58cc497bcee0a92189ecd652e5561ca65864 (patch)
tree7c30c35751164ffaedfcfc97e68ca0ac032c732d /lib
parent68bb4a066ce791967ea458c38e53e52ad0e4b8a6 (diff)
downloadnextcloud-server-4b8a58cc497bcee0a92189ecd652e5561ca65864.tar.gz
nextcloud-server-4b8a58cc497bcee0a92189ecd652e5561ca65864.zip
fix: appease linters and psalm
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/TextToImage/Manager.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/TextToImage/Manager.php b/lib/private/TextToImage/Manager.php
index 9bf5653971e..64c7a36cc02 100644
--- a/lib/private/TextToImage/Manager.php
+++ b/lib/private/TextToImage/Manager.php
@@ -157,8 +157,10 @@ class Manager implements IManager {
for ($i = 0; $i < $task->getNumberOfImages(); $i++) {
$file = $folder->newFile((string) $i);
$files[] = $file;
- $resources[] = $file->write();
- if (!is_resource($resources[count($resources) - 1])) {
+ $resource = $file->write();
+ if ($resource !== false && $resource !== true && is_resource($resource)) {
+ $resources[] = $resource;
+ } else {
throw new RuntimeException('Text2Image generation using provider "' . $provider->getName() . '" failed: Couldn\'t open file to write.');
}
}