Skip to content

Commit

Permalink
fix(admin_audit): Do not log errors for new files
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Aug 6, 2024
1 parent b6e3009 commit 7f5da07
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/admin_audit/lib/Actions/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
namespace OCA\AdminAudit\Actions;

use OC\Files\Node\NonExistingFile;
use OCP\Files\Events\Node\BeforeNodeReadEvent;
use OCP\Files\Events\Node\BeforeNodeRenamedEvent;
use OCP\Files\Events\Node\BeforeNodeWrittenEvent;
Expand Down Expand Up @@ -35,8 +36,9 @@ class Files extends Action {
*/
public function read(BeforeNodeReadEvent $event): void {
try {
$node = $event->getNode();
$params = [
'id' => $event->getNode()->getId(),
'id' => $node instanceof NonExistingFile::class ? $node->getId() : null,
'path' => mb_substr($event->getNode()->getInternalPath(), 5),
];
} catch (InvalidPathException|NotFoundException $e) {
Expand Down

0 comments on commit 7f5da07

Please sign in to comment.