Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2019-03-11 03:07:30 +0300
committerPhie <phie@phie.ovh>2019-03-11 03:08:11 +0300
commite37a8d10c8f0b27a779ce947cf27e2db0e752795 (patch)
treef5b7581eceed205cb2a6758bc7a2e2dcc901eefd /appinfo
parent2aad94c046b74a88a1897641d1f4894fc289004c (diff)
stop when no user
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/app.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
index 6533416..b81fb5f 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -50,8 +50,11 @@ class Application extends App {
$root = $container->query(IRootFolder::class);
$root->listen('\OC\Files', 'postWrite', function (Node $node) use ($container) {
$c = $container->query('ServerContainer');
- $watcher = new FSHooks($c->getUserFolder(), $c->getUserSession()->getUser()->getUID(), $c->getConfig(), 'carnet',$container->query(IDBConnection::class));
- $watcher->postWrite($node);
+ $user = $c->getUserSession()->getUser();
+ if($user != null){
+ $watcher = new FSHooks($c->getUserFolder(), $user->getUID(), $c->getConfig(), 'carnet',$container->query(IDBConnection::class));
+ $watcher->postWrite($node);
+ }
});
}
}