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; }