Gracefull handle link shares rename hook

Fixes #21678

The hook is called on all renames. However when we use a link share
the getUserFolder fails. We now just opt out.
This commit is contained in:
Roeland Jago Douma 2016-02-05 13:57:57 +01:00
parent 7dde2c773f
commit f4edfb6dfb
1 changed files with 6 additions and 0 deletions

View File

@ -73,6 +73,12 @@ class Shared_Updater {
*/
static private function moveShareToShare($path) {
$userFolder = \OC::$server->getUserFolder();
// If the user folder can't be constructed (e.g. link share) just return.
if ($userFolder === null) {
return;
}
$src = $userFolder->get($path);
$type = $src instanceof \OCP\Files\File ? 'file' : 'folder';