]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check if version has entity before trying to access it 38224/head
authorGit'Fellow <12234510+solracsf@users.noreply.github.com>
Fri, 12 May 2023 14:00:16 +0000 (16:00 +0200)
committerGitHub <noreply@github.com>
Fri, 12 May 2023 14:00:16 +0000 (16:00 +0200)
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
apps/files_versions/lib/Storage.php

index cd13e74e786321edbd9d68241b6f896cec2d4bfa..0b7debc126a0117b14cb573c9b50d700b13eaa86 100644 (file)
@@ -609,7 +609,7 @@ class Storage {
                        $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);
                        }