summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2022-06-29 13:50:30 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2022-06-29 16:56:37 +0200
commit5ebbb4e2b27d3fda6af410a553a196376d92034c (patch)
treeaa966577aded0548d8caba811fa705cbd286bb6a /connectivity
parentc78b49ec132eb5126445ebee7d259d3df7fcaa68 (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>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/macab/MacabAddressBook.cxx7
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?" );
+ }
}