summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-15 12:02:52 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-15 12:02:52 +0100
commit46b39c3465e2db9ba26b23d8d0dfca6cc670aaea (patch)
tree3747b008ca97402a049619e59e0b9342c0b71b65 /apps
parentfd21bfd9e894d81b67f375051d21dcdb2074c554 (diff)
parent479c458428ef56792f76ab0ab17a4933c6824cc2 (diff)
downloadnextcloud-server-46b39c3465e2db9ba26b23d8d0dfca6cc670aaea.tar.gz
nextcloud-server-46b39c3465e2db9ba26b23d8d0dfca6cc670aaea.zip
Merge pull request #22337 from owncloud/new_reshare_no_initiator
On backend hickups don't crash OCS output
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/api/share20ocs.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php
index 67a94aaf8aa..688ed5b3ee5 100644
--- a/apps/files_sharing/api/share20ocs.php
+++ b/apps/files_sharing/api/share20ocs.php
@@ -91,14 +91,14 @@ class Share20OCS {
'id' => $share->getId(),
'share_type' => $share->getShareType(),
'uid_owner' => $share->getSharedBy(),
- 'displayname_owner' => $sharedBy->getDisplayName(),
+ 'displayname_owner' => $sharedBy !== null ? $sharedBy->getDisplayName() : $share->getSharedBy(),
'permissions' => $share->getPermissions(),
'stime' => $share->getShareTime()->getTimestamp(),
'parent' => null,
'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();