diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index eec489a0e2..bee725362a 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -695,6 +695,11 @@ class Manager implements IManager { //reuse the node we already have $share->setNode($oldShare->getNode()); + // Reset the target if it is null for the new share + if ($share->getTarget() === '') { + $share->setTarget($target); + } + // Post share event $event = new GenericEvent($share); $this->eventDispatcher->dispatch('OCP\Share::postShare', $event);