Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 70a07d4

Browse files
committedDec 25, 2023
do not use default message if null passed for SystemException, ApplicationException, IOException
1 parent 63eadaf commit 70a07d4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
 

‎src/libraries/System.Private.CoreLib/src/System/ApplicationException.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public ApplicationException()
3333
// and its ExceptionInfo reference set to null.
3434
//
3535
public ApplicationException(string? message)
36-
: base(message ?? SR.Arg_ApplicationException)
36+
: base(message)
3737
{
3838
HResult = HResults.COR_E_APPLICATION;
3939
}
4040

4141
public ApplicationException(string? message, Exception? innerException)
42-
: base(message ?? SR.Arg_ApplicationException, innerException)
42+
: base(message, innerException)
4343
{
4444
HResult = HResults.COR_E_APPLICATION;
4545
}

‎src/libraries/System.Private.CoreLib/src/System/IO/IOException.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ public IOException()
1818
}
1919

2020
public IOException(string? message)
21-
: base(message ?? SR.Arg_IOException)
21+
: base(message)
2222
{
2323
HResult = HResults.COR_E_IO;
2424
}
2525

2626
public IOException(string? message, int hresult)
27-
: base(message ?? SR.Arg_IOException)
27+
: base(message)
2828
{
2929
HResult = hresult;
3030
}
3131

3232
public IOException(string? message, Exception? innerException)
33-
: base(message ?? SR.Arg_IOException, innerException)
33+
: base(message, innerException)
3434
{
3535
HResult = HResults.COR_E_IO;
3636
}

‎src/libraries/System.Private.CoreLib/src/System/SystemException.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ public SystemException()
1818
}
1919

2020
public SystemException(string? message)
21-
: base(message ?? SR.Arg_SystemException)
21+
: base(message)
2222
{
2323
HResult = HResults.COR_E_SYSTEM;
2424
}
2525

2626
public SystemException(string? message, Exception? innerException)
27-
: base(message ?? SR.Arg_SystemException, innerException)
27+
: base(message, innerException)
2828
{
2929
HResult = HResults.COR_E_SYSTEM;
3030
}

0 commit comments

Comments
 (0)
Please sign in to comment.