Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: don't try to get fileid for non exising nodes when serializing e…
…vents file

Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and AndyScherzinger committed Jul 2, 2025
commit a79034c0569c833be79be537804996604779bd3e
16 changes: 12 additions & 4 deletions lib/public/EventDispatcher/JsonSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace OCP\EventDispatcher;

use OC\Files\Node\NonExistingFile;
use OC\Files\Node\NonExistingFolder;
use OCP\Files\FileInfo;
use OCP\IUser;

Expand All @@ -24,10 +26,16 @@ final class JsonSerializer {
* @since 30.0.0
*/
public static function serializeFileInfo(FileInfo $node): array {
return [
'id' => $node->getId(),
'path' => $node->getPath(),
];
if ($node instanceof NonExistingFile || $node instanceof NonExistingFolder) {
return [
'path' => $node->getPath(),
];
} else {
return [
'id' => $node->getId(),
'path' => $node->getPath(),
];
}
}

/**
Expand Down
Loading