提交 f3ff7201 编写于 作者: J Jason Malinowski

Fix document.GetOptionsAsync().WithChangedOption potentially throwing

If we both had a document-specific option provided and also tried
to change the value, we'd end up throwing an exception.
上级 a968f8bc
......@@ -206,7 +206,7 @@ public DocumentSpecificOptionSet(List<IDocumentOptions> documentOptions, OptionS
public override OptionSet WithChangedOption(OptionKey optionAndLanguage, object? value)
{
return new DocumentSpecificOptionSet(_documentOptions, _underlyingOptions, _values.Add(optionAndLanguage, value));
return new DocumentSpecificOptionSet(_documentOptions, _underlyingOptions, _values.SetItem(optionAndLanguage, value));
}
internal override IEnumerable<OptionKey> GetChangedOptions(OptionSet optionSet)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册