mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: don't try to get fileid for non exising nodes when serializing events file
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
a28526dd63
commit
ab6f418340
1 changed files with 12 additions and 4 deletions
|
|
@ -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,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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue