aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-03-13 17:17:43 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-04-14 18:37:12 +0000
commita717b385767e6f7572b70383086593b9308f5502 (patch)
treea016501b6c889c7337451b2a49a729e0d920806f /lib
parent276a650d0f6c9d1a32a6affbc0501f08e1772047 (diff)
downloadnextcloud-server-a717b385767e6f7572b70383086593b9308f5502.tar.gz
nextcloud-server-a717b385767e6f7572b70383086593b9308f5502.zip
Handle unset owner in sharing
Signed-off-by: Joas Schilling <coding@schilljs.com>
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 82e948344c1..8301ae3b4ad 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);
@@ -711,7 +711,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