summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/api
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-02-12 10:44:34 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-02-12 10:45:33 +0100
commit479c458428ef56792f76ab0ab17a4933c6824cc2 (patch)
tree3bd430c5ac421851676e8bcf3480099246f6fde9 /apps/files_sharing/api
parent0a33cdee0cbd7b76180e18e50db8ce8938086789 (diff)
downloadnextcloud-server-479c458428ef56792f76ab0ab17a4933c6824cc2.tar.gz
nextcloud-server-479c458428ef56792f76ab0ab17a4933c6824cc2.zip
The owner and recipient can also be null
If we have backend hickups it can be that we are unable to retrive the owner and recipient user as well. In such cases just return the UID.
Diffstat (limited to 'apps/files_sharing/api')
-rw-r--r--apps/files_sharing/api/share20ocs.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php
index 993a069fe64..688ed5b3ee5 100644
--- a/apps/files_sharing/api/share20ocs.php
+++ b/apps/files_sharing/api/share20ocs.php
@@ -98,7 +98,7 @@ class Share20OCS {
'expiration' => null,
'token' => null,
'uid_file_owner' => $share->getShareOwner(),
- 'displayname_file_owner' => $shareOwner->getDisplayName(),
+ 'displayname_file_owner' => $shareOwner !== null ? $shareOwner->getDisplayName() : $share->getShareOwner(),
];
$node = $share->getNode();
@@ -117,8 +117,8 @@ class Share20OCS {
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
$sharedWith = $this->userManager->get($share->getSharedWith());
- $result['share_with'] = $sharedWith->getUID();
- $result['share_with_displayname'] = $sharedWith->getDisplayName();
+ $result['share_with'] = $share->getSharedWith();
+ $result['share_with_displayname'] = $sharedWith !== null ? $sharedWith->getDisplayName() : $share->getSharedWith();
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) {
$result['share_with'] = $share->getSharedWith();
$result['share_with_displayname'] = $share->getSharedWith();