fix(admin_audit): Avoid crash when rename event fileid changes

This was fixed on master another way, but for stable31 we should still
 avoid the crash.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2025-06-24 16:28:58 +02:00
parent 5f63c89955
commit e2a0ed080b
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -73,7 +73,7 @@ class Files extends Action {
public function afterRename(NodeRenamedEvent $event): void {
try {
$target = $event->getTarget();
$originalSource = $this->renamedNodes[$target->getId()];
$originalSource = $this->renamedNodes[$target->getId()] ?? $event->getSource();
$params = [
'newid' => $target->getId(),
'oldpath' => $originalSource->getPath(),