fix(adminaudit): Don't crash when creating folder

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/47252/head
Joas Schilling 9 months ago
parent e218d1f98e
commit 774427a03a
No known key found for this signature in database
GPG Key ID: 74434EFE0D2E2205
  1. 5
      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(

Loading…
Cancel
Save