Skip to content

Commit

Permalink
close stream if required
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Jul 27, 2024
1 parent a5285c1 commit 009e008
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/MediaCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public function __construct(
public bool $public = false,
public ?string $disk = null,
public null|string|Closure $fallback = null,
) {}
) {
}
}
4 changes: 3 additions & 1 deletion src/MediaZipper.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public function toFile(Filesystem $storage, string $path, array $options = []):

$success = $storage->writeStream($path, $temporaryStream, $options);

fclose($temporaryStream);
if (is_resource($temporaryStream)) {
fclose($temporaryStream);
}

return $success ? $path : false;
}
Expand Down

0 comments on commit 009e008

Please sign in to comment.