diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index aeaaa54f3708d..95824f5eca6ea 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -155,12 +155,13 @@ private function init() { /** @var IRootFolder $rootFolder */ $rootFolder = Server::get(IRootFolder::class); - $this->ownerUserFolder = $rootFolder->getUserFolder($this->superShare->getShareOwner()); + $owner = $this->superShare->getShareOwner(); + $this->ownerUserFolder = $rootFolder->getUserFolder($owner); $sourceId = $this->superShare->getNodeId(); $ownerNodes = $this->ownerUserFolder->getById($sourceId); if (count($ownerNodes) === 0) { - $this->storage = new FailedStorage(['exception' => new NotFoundException("File by id $sourceId not found")]); + $this->storage = new FailedStorage(['exception' => new NotFoundException("File by id $sourceId not found for user $owner")]); $this->cache = new FailedCache(); $this->rootPath = ''; } else {