Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2020-04-14 21:34:17 +0300
committerGitHub <noreply@github.com>2020-04-14 21:34:17 +0300
commit0bd7382a4445bb678116cd139f5de469380244a1 (patch)
tree2b2b9e397084a251d231725eb00204276bb3c4a4 /lib
parentcde6d768de0c48d470e6585d9b688c241187e229 (diff)
parent186c7f1b4b3a5356458190e599faf7668ec66a30 (diff)
Merge pull request #19936 from nextcloud/bugfix/noid/handle-unset-owner-in-sharing
Handle unset owner in sharing
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index b9a97e4225f..78d79b5c4da 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -302,7 +302,7 @@ class Manager implements IManager {
$isFederatedShare = $share->getNode()->getStorage()->instanceOfStorage('\OCA\Files_Sharing\External\Storage');
$permissions = 0;
$mount = $share->getNode()->getMountPoint();
- if (!$isFederatedShare && $share->getNode()->getOwner()->getUID() !== $share->getSharedBy()) {
+ if (!$isFederatedShare && $share->getNode()->getOwner() && $share->getNode()->getOwner()->getUID() !== $share->getSharedBy()) {
// When it's a reshare use the parent share permissions as maximum
$userMountPointId = $mount->getStorageRootId();
$userMountPoints = $userFolder->getById($userMountPointId);
@@ -710,7 +710,11 @@ class Manager implements IManager {
}
$share->setShareOwner($parent->getOwner()->getUID());
} else {
- $share->setShareOwner($share->getNode()->getOwner()->getUID());
+ if ($share->getNode()->getOwner()) {
+ $share->setShareOwner($share->getNode()->getOwner()->getUID());
+ } else {
+ $share->setShareOwner($share->getSharedBy());
+ }
}
//Verify share type