Skip to content

Commit b1871ca

Browse files
committed
Don't throw ArgumentNullException in internal code
Nullable reference types are enabled on the project and TreatWarningsAsErrors is set to true. So this kind of error would be caught at compilation time. This also allows to get rid of convoluted unit tests.
1 parent 5b5cc83 commit b1871ca

File tree

2 files changed

+3
-81
lines changed

2 files changed

+3
-81
lines changed

src/Log4NetTextFormatterOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ internal Log4NetTextFormatterOptions(IFormatProvider? formatProvider, CDataMode
1313
FormatProvider = formatProvider;
1414
CDataMode = cDataMode;
1515
Log4NetXmlNamespace = log4NetXmlNamespace;
16-
XmlWriterSettings = xmlWriterSettings ?? throw new ArgumentNullException(nameof(xmlWriterSettings));
17-
FilterProperty = filterProperty ?? throw new ArgumentNullException(nameof(filterProperty));
18-
FormatException = formatException ?? throw new ArgumentNullException(nameof(formatException));
16+
XmlWriterSettings = xmlWriterSettings;
17+
FilterProperty = filterProperty;
18+
FormatException = formatException;
1919
}
2020

2121
/// See <see cref="Log4NetTextFormatterOptionsBuilder.FormatProvider"/>

tests/Log4NetTextFormatterOptionsTest.cs

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)