mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Check if version entity is not null before delete
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
9260ef5c29
commit
07b82d7864
1 changed files with 6 additions and 1 deletions
|
|
@ -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]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue