diff --git a/lib/private/TextToImage/Manager.php b/lib/private/TextToImage/Manager.php index f59a5b27b9f1a..4d6c6b75da6a5 100644 --- a/lib/private/TextToImage/Manager.php +++ b/lib/private/TextToImage/Manager.php @@ -158,7 +158,7 @@ public function runTask(Task $task): void { $file = $folder->newFile((string) $i); $files[] = $file; $resources[] = $file->write(); - if ($resources[count($resources) - 1] === false) { + if (!is_resource($resources[count($resources) - 1])) { throw new RuntimeException('Text2Image generation using provider "' . $provider->getName() . '" failed: Couldn\'t open file to write.'); } }