From d6eb48c436ad3a8ede7e841bd1a1995ee025b43c Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Fri, 12 May 2023 16:00:16 +0200 Subject: [PATCH] Check if version has entity before trying to access it Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- apps/files_versions/lib/Storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index cd13e74e786..0b7debc126a 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -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); } -- 2.39.5