fix: don't try to get fileid for non exising nodes when serializing events file

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/53648/head
Robin Appelman 4 months ago
parent a28526dd63
commit ab6f418340
  1. 8
      lib/public/EventDispatcher/JsonSerializer.php

@ -9,6 +9,8 @@ declare(strict_types=1);
namespace OCP\EventDispatcher;
use OC\Files\Node\NonExistingFile;
use OC\Files\Node\NonExistingFolder;
use OCP\Files\FileInfo;
use OCP\IUser;
@ -24,11 +26,17 @@ final class JsonSerializer {
* @since 30.0.0
*/
public static function serializeFileInfo(FileInfo $node): array {
if ($node instanceof NonExistingFile || $node instanceof NonExistingFolder) {
return [
'path' => $node->getPath(),
];
} else {
return [
'id' => $node->getId(),
'path' => $node->getPath(),
];
}
}
/**
* @since 30.0.0

Loading…
Cancel
Save