Merge pull request #53747 from nextcloud/backport/53648/stable30

[stable30] fix: don't try to get fileid for non exising nodes when serializing events file
This commit is contained in:
Andy Scherzinger 2025-07-03 10:34:59 +02:00 committed by GitHub
commit 5bcd26985b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(),
];
}
}
/**