diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2023-05-09 17:11:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-09 17:11:57 +0200 |
commit | 416f632280a4eccc53e09c691ae0cfbc66c0ffd8 (patch) | |
tree | a37b8aab7510d827a3ffa89198d21ab3b207a1d3 /apps | |
parent | f734a7646639549b626c05b12a789c8cdedf2511 (diff) | |
parent | 7cd5cbe6e9e7d79039f89034b90a13c3aa0b9278 (diff) | |
download | nextcloud-server-416f632280a4eccc53e09c691ae0cfbc66c0ffd8.tar.gz nextcloud-server-416f632280a4eccc53e09c691ae0cfbc66c0ffd8.zip |
Merge pull request #38125 from nextcloud/versionEntityCheck
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]); } |