connectivity/source/drivers/macab/MacabAddressBook.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 3bb757446bd6bacacfc97f02936801d8f2275b87
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:03 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 5ebbb4e2b27d3fda6af410a553a196376d92034c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136641
    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?" );
+    }
 }
 
 

Reply via email to