diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2022-06-29 13:50:30 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-07-02 17:08:28 +0200 |
commit | 9b744661fd39c4c897110a4b61e3957570881f07 (patch) | |
tree | 98b3e97c682cf7e8fcf87a2bf99da1abbd62662f /connectivity | |
parent | 0d6ec5922036afd91497fa02e0adadb08b0af7d0 (diff) |
related tdf#126961 don't crash when access to the macOS address book is denied
quick'n'dirty fix, ideally the user should get a message to reset the
privacy setting and try again...
Change-Id: I51cb852e305e285c87ff3a0e15b5198a2b1c5970
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136620
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
(cherry picked from commit 5ab29d945a18824eec53426edece4f19a02610ed)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136640
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/macab/MacabAddressBook.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/connectivity/source/drivers/macab/MacabAddressBook.cxx b/connectivity/source/drivers/macab/MacabAddressBook.cxx index a14b7abee9b9..02d4faf74290 100644 --- a/connectivity/source/drivers/macab/MacabAddressBook.cxx +++ b/connectivity/source/drivers/macab/MacabAddressBook.cxx @@ -82,6 +82,13 @@ MacabAddressBook::MacabAddressBook( ) m_xMacabRecords(nullptr), m_bRetrievedGroups(false) { + if(m_aAddressBook == nullptr) + { + // TODO: tell the user to reset the permission via "tccutil reset AddressBook" + // or the system preferences and try again, this time granting the access + throw RuntimeException( + "failed to access the macOS address book - permission not granted?" ); + } } |