From c6b540a738c3e361d9533cf841e208535e8d8483 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 27 Nov 2018 17:09:55 +0100 Subject: [PATCH] =?UTF-8?q?be=20careful=20with=20mixed=20return=20values?= =?UTF-8?q?=20even=20if=20it=20may=20look=20unsuspicious=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Arthur Schiwon --- apps/dav/lib/CardDAV/SyncService.php | 2 +- apps/dav/lib/HookManager.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/CardDAV/SyncService.php b/apps/dav/lib/CardDAV/SyncService.php index 5bd92015ad..6f6fa0ba37 100644 --- a/apps/dav/lib/CardDAV/SyncService.php +++ b/apps/dav/lib/CardDAV/SyncService.php @@ -261,7 +261,7 @@ class SyncService { /** * @param IUser $user */ - public function updateUser($user) { + public function updateUser(IUser $user) { $systemAddressBook = $this->getLocalSystemAddressBook(); $addressBookId = $systemAddressBook['id']; $converter = new Converter($this->accountManager); diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php index b1bd039c65..27b6525be4 100644 --- a/apps/dav/lib/HookManager.php +++ b/apps/dav/lib/HookManager.php @@ -101,7 +101,9 @@ class HookManager { public function postCreateUser($params) { $user = $this->userManager->get($params['uid']); - $this->syncService->updateUser($user); + if ($user instanceof IUser) { + $this->syncService->updateUser($user); + } } public function preDeleteUser($params) {