Skip to content

Commit

Permalink
Folder Preview stream_get_contents(): Argument #1 ($stream) must be o…
Browse files Browse the repository at this point in the history
…f type resource, null given

Folder Preview $tileThumb->getStream can return null
  • Loading branch information
dpfaffenbauer authored and dvesh3 committed Jan 2, 2023
1 parent b7f8f66 commit 179a556
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion models/Asset/Folder.php
Expand Up @@ -183,7 +183,13 @@ public function getPreviewImage(bool $force = false)
break;
}

$tile = imagecreatefromstring(stream_get_contents($tileThumb->getStream()));
$stream = $tileThumb->getStream();

if (null === $stream) {
break;
}

$tile = imagecreatefromstring(stream_get_contents($stream));
imagecopyresampled($collage, $tile, $offsetLeft, $offsetTop, 0, 0, $squareDimension, $squareDimension, $tileThumb->getWidth(), $tileThumb->getHeight());

$count++;
Expand Down

0 comments on commit 179a556

Please sign in to comment.