aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/EventDispatcher
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-06-23 17:38:09 +0200
committerRobin Appelman <robin@icewind.nl>2025-06-27 20:52:32 +0200
commitab6f418340abdd654b02f4b4d6b4dcb1798cf4a5 (patch)
tree869cfecc37be406f18de3afec49551fcf066dafe /lib/public/EventDispatcher
parenta28526dd63d85cb465b8ac78eb0c680405146f42 (diff)
downloadnextcloud-server-rename-hooks-webhook.tar.gz
nextcloud-server-rename-hooks-webhook.zip
fix: don't try to get fileid for non exising nodes when serializing events filerename-hooks-webhook
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/public/EventDispatcher')
-rw-r--r--lib/public/EventDispatcher/JsonSerializer.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/public/EventDispatcher/JsonSerializer.php b/lib/public/EventDispatcher/JsonSerializer.php
index 1eb75ed7527..d05367b746d 100644
--- a/lib/public/EventDispatcher/JsonSerializer.php
+++ b/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,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(),
+ ];
+ }
}
/**