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

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2020-08-13 17:46:04 +0300
committerdartcafe <github@dartcafe.de>2020-08-13 17:46:04 +0300
commit081a116dd0155356f5b5475d0386168f01146ef8 (patch)
treeba293fa70557a5f477529ff0019f6885b3f043f3 /lib/Service
parentc30ac7f507542048780d73fa8029557aeb361403 (diff)
catch error on getDisplayName for groups
Diffstat (limited to 'lib/Service')
-rw-r--r--lib/Service/SystemService.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Service/SystemService.php b/lib/Service/SystemService.php
index 5cabdadf..dbc37c3f 100644
--- a/lib/Service/SystemService.php
+++ b/lib/Service/SystemService.php
@@ -122,11 +122,19 @@ class SystemService {
$groups = array();
foreach ($this->groupManager->search($query) as $group) {
if (!in_array($group->getGID(), $skip)) {
+ try {
+ // seems to work only from NC19 on
+ $displayName = $group->getDisplayName();
+ } catch (\Exception $e) {
+ // fallback
+ $displayName = $group->getGID();
+ }
+
$groups[] = [
'id' => $group->getGID(),
'user' => $group->getGID(),
'organisation' => '',
- 'displayName' => $group->getDisplayName(),
+ 'displayName' => $displayName,
'emailAddress' => '',
'desc' => 'Group',
'type' => 'group',