It can show up as various exceptions, but in this case it's an System.IndexOutOfRangeException
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at RtfPipe.ControlTag.Negate(ControlWord`1 word)
at RtfPipe.Model.HtmlVisitor.GetNewStyles(IEnumerable`1 styles, HtmlTag tag)
at RtfPipe.Model.HtmlVisitor.Visit(Element element)
at RtfPipe.Model.HtmlVisitor.Visit(Element element)
at RtfPipe.Model.HtmlVisitor.Visit(RtfHtml document)
at RtfPipe.Rtf.ToHtml(RtfSource source, XmlWriter writer, RtfHtmlSettings settings)
at RtfPipe.Rtf.ToHtml(RtfSource source, RtfHtmlSettings settings)
In an attempt to scale out, I found that https://github.com/erdomke/RtfPipe/blob/9851ab97d693037073d567d74346184ae2f3d4b3/RtfPipe/Tokens/ControlTag.cs#L38 is being accessed in a manner that isn't thread-safe inside of https://github.com/erdomke/RtfPipe/blob/9851ab97d693037073d567d74346184ae2f3d4b3/RtfPipe/Tokens/ControlTag.cs#L40-L51
It can show up as various exceptions, but in this case it's an
System.IndexOutOfRangeException