From f25935b9cf9c451db83d999271ede5b01cf3e715 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Mon, 31 Aug 2026 14:34:58 +0200 Subject: [PATCH] fix(ObjectStorePreviewStorage): Close count stream wrapper So that the size is finalized Signed-off-by: Carl Schwan --- lib/private/Preview/Storage/ObjectStorePreviewStorage.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/private/Preview/Storage/ObjectStorePreviewStorage.php b/lib/private/Preview/Storage/ObjectStorePreviewStorage.php index 0a2f5e8f0122b..037588e72c825 100644 --- a/lib/private/Preview/Storage/ObjectStorePreviewStorage.php +++ b/lib/private/Preview/Storage/ObjectStorePreviewStorage.php @@ -56,6 +56,10 @@ public function writePreview(Preview $preview, mixed $stream): int { $store->writeObject($urn, $countStream); } catch (\Exception $exception) { throw new NotPermittedException('Unable to save preview to object store', previous: $exception); + } finally { + if (is_resource($countStream)) { + fclose($countStream); + } } return $size; }