diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-05 13:57:57 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-05 13:57:57 +0100 |
commit | f4edfb6dfb7208c1479375efea60f50c61eb2e09 (patch) | |
tree | 28500974adc8b5b60d4ba239f0c19ae7009c8318 /apps | |
parent | 7dde2c773f4efee0094176fe76b2c64f4f74a1ea (diff) | |
download | nextcloud-server-f4edfb6dfb7208c1479375efea60f50c61eb2e09.tar.gz nextcloud-server-f4edfb6dfb7208c1479375efea60f50c61eb2e09.zip |
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.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/updater.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php index 9a1e554046b..10da2462807 100644 --- a/apps/files_sharing/lib/updater.php +++ b/apps/files_sharing/lib/updater.php @@ -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'; |