Skip to content

Commit

Permalink
Add check for IMetadataVersion
Browse files Browse the repository at this point in the history
To prevent psalm errors.

Co-authored-by: Louis <[email protected]>
Signed-off-by: XueSheng-GIT <[email protected]>
  • Loading branch information
XueSheng-GIT and artonge authored Nov 2, 2024
1 parent 0be34e1 commit 4a26b13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Versions/ExpireManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4a26b13

Please sign in to comment.