summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-06-02 12:06:24 +0300
committerAndras Timar <andras.timar@collabora.com>2023-06-09 12:26:19 +0200
commit5cc78ce7d47663c5a7431c4ab93efa3d3f9f8b0a (patch)
treec79b62bdb28dd7c889c01b85ab9240b10e976ee8 /linguistic
parent779d5e279b5f85cabeb2f1ca3cacca0db4aaeec1 (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> (cherry picked from commit a5c1c674e031087ef0516cebac049341dcdd2fcf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152531 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
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 f38ee262099c..d1a12a396436 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -1493,6 +1493,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)