Skip to content

Commit

Permalink
Word Export: writing system that is not part of the project
Browse files Browse the repository at this point in the history
Prevent Word Export from crashing when we encounter a string
that uses a writing system that is not part of the current
FLEX project. This can happen when using copy/paste from one
FLEX project to another, and the projects use different
writing systems. See LT-21981.
Pasting table data from a custom field in one project to a
custom field in another project reproduced the crash.

Change-Id: Ic238b27a83e9591bc81eac9bdf4628ab11787352
  • Loading branch information
mark-sil committed Nov 6, 2024
1 parent fd69e47 commit 49771f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Src/xWorks/LcmWordGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,8 @@ public void AddRun(LcmCache cache, ConfigurableDictionaryNode config, ReadOnlyPr
else
{
StyleElement rootElem = s_styleCollection.GetStyleElement(wsString);
Style rootStyle = rootElem.Style;
// rootElem can be null, see LT-21981.
Style rootStyle = rootElem?.Style;
if (rootStyle != null)
{
Style basedOnStyle = WordStylesGenerator.GenerateBasedOnCharacterStyle(new Style(), wsString, displayNameBase);
Expand Down

0 comments on commit 49771f5

Please sign in to comment.