desktop/source/lib/init.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 278828dce69d3fc143a81d7d40f9e9368f8e2c89
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Apr 22 17:17:05 2024 +0100
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Apr 22 22:02:07 2024 +0200

    thesauri list can be empty at preload
    
    if none of the dictionaries are installed, seen in a bare bones docker
    image, giving a backtrace of:
    
    /usr/bin/coolforkit(_ZN7SigUtil13dumpBacktraceEv+0x73)[0x632d83]
    /usr/bin/coolforkit[0x6331a5]
    /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f48788b4980]
    
/opt/collaboraoffice/program/libuno_sal.so.3(rtl_uString_assign+0xc)[0x7f487070582c]
    /opt/collaboraoffice/program/libmergedlo.so(+0x20f9478)[0x7f4873cbc478]
    /opt/collaboraoffice/program/libmergedlo.so(+0x20fa3c4)[0x7f4873cbd3c4]
    /opt/collaboraoffice/program/libmergedlo.so(+0x27e6d82)[0x7f48743a9d82]
    /opt/collaboraoffice/program/libmergedlo.so(+0x27e8eac)[0x7f48743abeac]
    
/opt/collaboraoffice/program/libmergedlo.so(lok_preinit_2+0x1c)[0x7f48743ad31c]
    /usr/bin/coolforkit(_Z13globalPreinitRKSs+0x1e8)[0x5dfdd8]
    /usr/bin/coolforkit(_Z11forkit_mainiPPc+0x1582)[0x5aa482]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f48784d2c87]
    /usr/bin/coolforkit[0x56c392]
    
    Change-Id: Ib3a8ada7c22611e04e9db8dfa7cb0e227ece0f84
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166432
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c3afbf741a37..f13bc1f48e26 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7585,10 +7585,13 @@ static void preloadData()
     std::cerr << "
";
 
     std::cerr << "Preloading breakiterator: ";
-    css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = 
css::i18n::BreakIterator::create(xContext);
-    css::i18n::LineBreakUserOptions aUserOptions;
-    css::i18n::LineBreakHyphenationOptions aHyphOptions( 
LinguMgr::GetHyphenator(), css::uno::Sequence<beans::PropertyValue>(), 1 );
-    xBreakIterator->getLineBreak("", /*nMaxBreakPos*/0, aLocales[0], 
/*nMinBreakPos*/0, aHyphOptions, aUserOptions);
+    if (aLocales.getLength())
+    {
+        css::uno::Reference< css::i18n::XBreakIterator > xBreakIterator = 
css::i18n::BreakIterator::create(xContext);
+        css::i18n::LineBreakUserOptions aUserOptions;
+        css::i18n::LineBreakHyphenationOptions aHyphOptions( 
LinguMgr::GetHyphenator(), css::uno::Sequence<beans::PropertyValue>(), 1 );
+        xBreakIterator->getLineBreak("", /*nMaxBreakPos*/0, aLocales[0], 
/*nMinBreakPos*/0, aHyphOptions, aUserOptions);
+    }
 
     css::uno::Reference< css::ui::XAcceleratorConfiguration > xGlobalCfg = 
css::ui::GlobalAcceleratorConfiguration::create(
         comphelper::getProcessComponentContext());

Reply via email to