Skip to content

Commit 3577473

Browse files
committed
fix(ObjectStorePreviewStorage): Close count stream wrapper
So that the size is finalized Signed-off-by: Carl Schwan <carl@carlschwan.eu>
1 parent 0c3a617 commit 3577473

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/private/Preview/Storage/ObjectStorePreviewStorage.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public function writePreview(Preview $preview, mixed $stream): int {
5656
$store->writeObject($urn, $countStream);
5757
} catch (\Exception $exception) {
5858
throw new NotPermittedException('Unable to save preview to object store', previous: $exception);
59+
} finally {
60+
if (is_resource($countStream)) {
61+
fclose($countStream);
62+
}
5963
}
6064
return $size;
6165
}

0 commit comments

Comments
 (0)