Skip to content

Commit c4a8e75

Browse files
authored
Fix non-thread safe crash in Paratext Settings when viewing history (#3605)
1 parent 16b33f4 commit c4a8e75

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/SIL.XForge.Scripture/Services/ParatextService.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,6 +2254,10 @@ int chapter
22542254
{
22552255
string ptProjectId = projectDoc.Data.ParatextId;
22562256
scrText = GetScrText(userSecret, ptProjectId);
2257+
2258+
// The ScrText Settings maintains a non-thread safe dictionary cache of book filenames to book numbers.
2259+
// We initialize it here to prevent issues when iterating over revisions below.
2260+
_ = scrText.Settings.GetBookNumberFromFilename(string.Empty);
22572261
}
22582262
catch (DataNotFoundException)
22592263
{

0 commit comments

Comments
 (0)