connectivity/source/drivers/macab/MacabAddressBook.cxx | 7 +++++++ 1 file changed, 7 insertions(+)
New commits: commit d4b9f5219fa9aa9426f9815f1844c178a934205f Author: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> AuthorDate: Wed Jun 29 13:50:30 2022 +0200 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Thu Jun 30 09:20:22 2022 +0200 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+libreoff...@googlemail.com> (cherry picked from commit 5ab29d945a18824eec53426edece4f19a02610ed) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136640 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> 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?" ); + } }