diff options
author | Joas Schilling <coding@schilljs.com> | 2024-08-15 10:00:22 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-08-15 10:00:22 +0200 |
commit | 774427a03ae0093c5717ca2f4f36f25bbf13e6bb (patch) | |
tree | a0ab4ff1f524992d8bbfd7bb4359c818e3806d30 /apps/admin_audit | |
parent | e218d1f98e19307f2bf170e09670e4f7fe61f061 (diff) | |
download | nextcloud-server-774427a03ae0093c5717ca2f4f36f25bbf13e6bb.tar.gz nextcloud-server-774427a03ae0093c5717ca2f4f36f25bbf13e6bb.zip |
fix(adminaudit): Don't crash when creating folder
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/admin_audit')
-rw-r--r-- | apps/admin_audit/lib/Actions/Files.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/admin_audit/lib/Actions/Files.php b/apps/admin_audit/lib/Actions/Files.php index 80eabb3b1b7..bba5b427aee 100644 --- a/apps/admin_audit/lib/Actions/Files.php +++ b/apps/admin_audit/lib/Actions/Files.php @@ -159,10 +159,11 @@ class Files extends Action { * @param BeforeNodeWrittenEvent $event */ public function write(BeforeNodeWrittenEvent $event): void { + $node = $event->getNode(); try { $params = [ - 'id' => $event->getNode()->getId(), - 'path' => mb_substr($event->getNode()->getInternalPath(), 5), + 'id' => $node instanceof NonExistingFile ? null : $node->getId(), + 'path' => mb_substr($node->getInternalPath(), 5), ]; } catch (InvalidPathException|NotFoundException $e) { \OCP\Server::get(LoggerInterface::class)->error( |