summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2022-06-29 13:50:30 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2022-06-30 09:20:22 +0200
commitd4b9f5219fa9aa9426f9815f1844c178a934205f (patch)
tree14101f9e3277e04a506118f04150ade0c5b43c7a
parentdon't specify entitlements that are not used (sdremote w/o bluetooth) (diff)
downloadcore-d4b9f5219fa9aa9426f9815f1844c178a934205f.tar.gz
core-d4b9f5219fa9aa9426f9815f1844c178a934205f.zip
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>
-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?" );
+ }
}