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(),