From 5f761cc31c7e683eed3d0501c8a317fadfac2468 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 31 Oct 2024 20:46:56 -0100 Subject: [PATCH] fix toArray on null Signed-off-by: Maxence Lange --- lib/Model/ShareWrapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Model/ShareWrapper.php b/lib/Model/ShareWrapper.php index c95079eac..73cf36094 100644 --- a/lib/Model/ShareWrapper.php +++ b/lib/Model/ShareWrapper.php @@ -592,7 +592,7 @@ public function jsonSerialize(): array { 'shareType' => $this->getShareType(), 'providerId' => $this->getProviderId(), 'permissions' => $this->getPermissions(), - 'attributes' => json_encode($this->getAttributes()->toArray()), + 'attributes' => ($this->getAttributes() !== null) ? json_encode($this->getAttributes()->toArray()) : null, 'hideDownload' => $this->getHideDownload(), 'itemType' => $this->getItemType(), 'itemSource' => $this->getItemSource(),