aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-11-14 12:45:36 +0100
committerVincent Petry <pvince81@owncloud.com>2014-11-14 16:43:23 +0100
commitc941c3fa5139ba4f122d4f40d9c9db5e50f8bcb7 (patch)
treec67cd586a0ad5ca07df5197a69c71f19fea2e158 /apps/files_external
parent9368de5a8be5b77804fe7b9b1c8d66d5161f7f76 (diff)
downloadnextcloud-server-c941c3fa5139ba4f122d4f40d9c9db5e50f8bcb7.tar.gz
nextcloud-server-c941c3fa5139ba4f122d4f40d9c9db5e50f8bcb7.zip
Show warning when invalid user was passed
Sometimes there are bugs that cause setupFS() to be called for non-existing users. Instead of failing hard and breaking the instance, this fix simply logs a warning.
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/config.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index fa44e446d96..9400bbdedc0 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -121,6 +121,14 @@ class OC_Mount_Config {
if ($data['user']) {
$user = \OC::$server->getUserManager()->get($data['user']);
+ if (!$user) {
+ \OC_Log::write(
+ 'files_external',
+ 'Cannot init external mount points for non-existant user "' . $data['user'] . '".',
+ \OC_Log::WARN
+ );
+ return;
+ }
$userView = new \OC\Files\View('/' . $user->getUID() . '/files');
$changePropagator = new \OC\Files\Cache\ChangePropagator($userView);
$etagPropagator = new \OCA\Files_External\EtagPropagator($user, $changePropagator, \OC::$server->getConfig());