From 6c039fa68d407ef773f36baa22c386d34f5c2100 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 c42c60a1b..691a21e43 100644 --- a/lib/Model/ShareWrapper.php +++ b/lib/Model/ShareWrapper.php @@ -630,7 +630,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(),