diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2023-05-08 14:24:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 14:24:58 +0200 |
commit | 7cd5cbe6e9e7d79039f89034b90a13c3aa0b9278 (patch) | |
tree | a68b72056b29c0b6793796db22bb1493124962bf /apps | |
parent | 598859d96995cf8857da9733883cf6ed95fd1524 (diff) | |
download | nextcloud-server-7cd5cbe6e9e7d79039f89034b90a13c3aa0b9278.tar.gz nextcloud-server-7cd5cbe6e9e7d79039f89034b90a13c3aa0b9278.zip |
Check if version entity is not null before delete
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_versions/lib/Storage.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 9141e6c4c65..cd13e74e786 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -608,7 +608,12 @@ class Storage { foreach ($versions as $version) { $internalPath = $version->getInternalPath(); \OC_Hook::emit('\OCP\Versions', 'preDelete', ['path' => $internalPath, 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]); - $versionsMapper->delete($versionEntities[$version->getId()]); + + $versionEntity = $versionEntities[$version->getId()]; + if (!is_null($versionEntity)) { + $versionsMapper->delete($versionEntity); + } + $version->delete(); \OC_Hook::emit('\OCP\Versions', 'delete', ['path' => $internalPath, 'trigger' => self::DELETE_TRIGGER_RETENTION_CONSTRAINT]); } |