Skip to content

Commit 2f467d9

Browse files
authored
Merge pull request #38224 from nextcloud/versionEntityisSet
Check if version has entity before trying to access it
2 parents 7fd453e + d6eb48c commit 2f467d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/files_versions/lib/Storage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ public static function expireOlderThanMaxForUser($uid) {
609609
$internalPath = $version->getInternalPath();
610610
\OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $internalPath, 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);
611611

612-
$versionEntity = $versionEntities[$version->getId()];
612+
$versionEntity = isset($versionEntities[$version->getId()]) ? $versionEntities[$version->getId()] : null;
613613
if (!is_null($versionEntity)) {
614614
$versionsMapper->delete($versionEntity);
615615
}

0 commit comments

Comments
 (0)