Skip to content

Commit 5835057

Browse files
committed
fix: avoid calling virtual members in constructor
Signed-off-by: Vincent Biret <[email protected]>
1 parent 5930916 commit 5835057

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Microsoft.OpenApi/Writers/FormattingStreamWriter.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ public class FormattingStreamWriter : StreamWriter
1919
public FormattingStreamWriter(Stream stream, IFormatProvider formatProvider)
2020
: base(stream)
2121
{
22-
this.FormatProvider = formatProvider;
22+
_formatProvider = formatProvider;
2323
}
24+
private readonly IFormatProvider _formatProvider;
2425

2526
/// <summary>
2627
/// The <see cref="IFormatProvider"/> associated with this <see cref="FormattingStreamWriter"/>.
2728
/// </summary>
28-
public override IFormatProvider FormatProvider { get; }
29+
public override IFormatProvider FormatProvider { get => _formatProvider; }
2930
}
3031
}

0 commit comments

Comments
 (0)