diff options
author | Joas Schilling <coding@schilljs.com> | 2024-08-15 10:00:22 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-08-15 13:35:19 +0000 |
commit | b31a587be89717b10c84c198480411a00fd6da44 (patch) | |
tree | a33265c79a3d2488645694af9abdb278206e6f65 /apps/admin_audit | |
parent | 3b6d9eb774919270728f1d2a68e0527cde74446e (diff) | |
download | nextcloud-server-b31a587be89717b10c84c198480411a00fd6da44.tar.gz nextcloud-server-b31a587be89717b10c84c198480411a00fd6da44.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( |