Skip to content

Commit

Permalink
Merge pull request #38224 from nextcloud/versionEntityisSet
Browse files Browse the repository at this point in the history
Check if version has entity before trying to access it
  • Loading branch information
artonge authored May 15, 2023
2 parents 7fd453e + d6eb48c commit 2f467d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/files_versions/lib/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ public static function expireOlderThanMaxForUser($uid) {
$internalPath = $version->getInternalPath();
\OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $internalPath, 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]);

$versionEntity = $versionEntities[$version->getId()];
$versionEntity = isset($versionEntities[$version->getId()]) ? $versionEntities[$version->getId()] : null;
if (!is_null($versionEntity)) {
$versionsMapper->delete($versionEntity);
}
Expand Down

0 comments on commit 2f467d9

Please sign in to comment.