mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(admin_audit): Do not log errors for new files
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
80fc2a96f2
commit
1c0f02eea9
1 changed files with 4 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ declare(strict_types=1);
|
|||
*/
|
||||
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;
|
||||
|
|
@ -35,9 +36,10 @@ class Files extends Action {
|
|||
*/
|
||||
public function read(BeforeNodeReadEvent $event): void {
|
||||
try {
|
||||
$node = $event->getNode();
|
||||
$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…
Reference in a new issue