Skip to content

Commit

Permalink
Merge pull request #47252 from nextcloud/bugfix/noid/dont-crash-when-…
Browse files Browse the repository at this point in the history
…creating-folder

fix(adminaudit): Don't crash when creating folder
  • Loading branch information
nickvergessen authored Aug 15, 2024
2 parents 601b3b1 + 774427a commit 15550de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/admin_audit/lib/Actions/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ public function copy(NodeCopiedEvent $event): void {
* @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(
Expand Down

0 comments on commit 15550de

Please sign in to comment.