diff options
author | Joas Schilling <coding@schilljs.com> | 2020-03-13 17:17:43 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-03-13 17:17:43 +0100 |
commit | 186c7f1b4b3a5356458190e599faf7668ec66a30 (patch) | |
tree | ae05e4a5c771c5a92d4bf516b646a6f245ed7222 /lib/private/Share20 | |
parent | dc0ee357a42763738cb13d368b25c1b94619cbca (diff) | |
download | nextcloud-server-186c7f1b4b3a5356458190e599faf7668ec66a30.tar.gz nextcloud-server-186c7f1b4b3a5356458190e599faf7668ec66a30.zip |
Handle unset owner in sharing
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Share20')
-rw-r--r-- | lib/private/Share20/Manager.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index ca668e24e7f..3e22e7158ca 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 |