Skip to content

Commit

Permalink
Check if version has entity before trying to access it
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
solracsf authored May 12, 2023
1 parent ba867b6 commit d6eb48c
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 d6eb48c

Please sign in to comment.