summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-06-02 12:06:24 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-06-02 13:07:17 +0200
commita5c1c674e031087ef0516cebac049341dcdd2fcf (patch)
tree7c914b2bce776a48abad3091f47ddb6bf591b1ac /linguistic
parent8aa623714fd36cf8303ab3bdef0f26db7e69a07c (diff)
Fix nullptr dereference
Seen e.g. in builds where no grammar checker was available (like bibisect, or own builds), and LanguageTool is enabled in its page, and then enabled in Writing Aids options page (Available Language Modules list) in the same session, without program restart. Change-Id: I5ac007ec5e1dfc860085bfd3f95aa61a737ec449 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152529 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/lngsvcmgr.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 73abcf92abd5..69e884257e33 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -1488,6 +1488,8 @@ void SAL_CALL
{
if (!mxGrammarDsp.is())
GetGrammarCheckerDsp_Impl();
+ if (!mxGrammarDsp) // e.g., when !SvtLinguConfig().HasGrammarChecker()
+ return;
bool bChanged = !IsEqSvcList( rServiceImplNames,
mxGrammarDsp->GetServiceList( rLocale ) );
if (bChanged)