summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/source/lib/init.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 88d618cd288e..273446f1f142 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -577,7 +577,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
try
{
- osl_setCommandArgs(0, NULL);
+ // If we've set up the command args elsewhere then we cannot do it
+ // again (as an assert will fire), this will be the case e.g.
+ // for unit tests (and possibly if UNO is being used in addition
+ // to LOK in an external program).
+ if (!osl_areCommandArgsSet())
+ {
+ osl_setCommandArgs(0, NULL);
+ }
initialize_uno(aAppURL);
force_c_locale();