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

index 3a925cfbd8b22a1e3162099f29057cb410218a22..927788b08788b4142eeea8f2ab1837a80429cd9a 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);
                        }