Skip to content

Commit c05de67

Browse files
Don't pass invalid streams to Imaginary
Signed-off-by: Git'Fellow <[email protected]> Update Imaginary.php Signed-off-by: Git'Fellow <[email protected]> Update Imaginary.php Signed-off-by: Git'Fellow <[email protected]>
1 parent 26d35d9 commit c05de67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/private/Preview/Imaginary.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ public function getCroppedThumbnail(File $file, int $maxX, int $maxY, bool $crop
7878

7979
// Object store
8080
$stream = $file->fopen('r');
81+
if (!$stream || !is_resource($stream) || feof($stream)) {
82+
return null;
83+
}
8184

8285
$httpClient = $this->service->newClient();
8386

0 commit comments

Comments
 (0)