From 4a26b13770c49ce748376cd60edc092b5aef4f78 Mon Sep 17 00:00:00 2001 From: XueSheng-GIT Date: Sat, 2 Nov 2024 05:22:50 +0100 Subject: [PATCH] Add check for IMetadataVersion To prevent psalm errors. Co-authored-by: Louis Signed-off-by: XueSheng-GIT --- lib/Versions/ExpireManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Versions/ExpireManager.php b/lib/Versions/ExpireManager.php index 97012e0eb..9f82e42d3 100644 --- a/lib/Versions/ExpireManager.php +++ b/lib/Versions/ExpireManager.php @@ -67,7 +67,7 @@ protected function getAutoExpireList(int $time, array $versions): array { if ($nextInterval === -1 || $prevTimestamp > $nextInterval) { if ($version->getTimestamp() > $nextVersion) { // Do not expire versions with a label. - if ($version->getMetadataValue('label') === null || $version->getMetadataValue('label') === '') { + if (!($version instanceof IMetadataVersion) || $version->getMetadataValue('label') === null || $version->getMetadataValue('label') === '') { //distance between two version too small, mark to delete $toDelete[] = $version; }