From d6adfd5c298e4b49b9c693ae7f431c70bf7621a3 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 21 Apr 2023 22:25:29 +0200 Subject: [PATCH] Fix PHP warning: Trying to access array offset on value of type null > PHP Warning: Trying to access array offset on value of type null > in plugins/nextcloud_sql_addressbook/nextcloud_sql_addressbook.php > on line 97 --- nextcloud_sql_addressbook.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nextcloud_sql_addressbook.php b/nextcloud_sql_addressbook.php index 146aebe..5c52fde 100644 --- a/nextcloud_sql_addressbook.php +++ b/nextcloud_sql_addressbook.php @@ -93,6 +93,10 @@ class nextcloud_sql_addressbook extends rcube_plugin */ protected function listAddressbooks() { + if (!isset($this->rcube->user->data)) { + return []; + } + $principalUri = 'principals/users/' . $this->rcube->user->data['username']; -- 2.30.2