File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ public virtual void SetAddress(string addr)
123
123
m_address . Resolve ( addr , m_options . IPv4Only ) ;
124
124
125
125
Assumes . NotNull ( m_address . Address ) ;
126
- Assumes . NotNull ( m_handle ) ;
126
+ Assumes . Null ( m_handle ) ;
127
127
128
128
try
129
129
{
Original file line number Diff line number Diff line change @@ -9,8 +9,14 @@ internal static class Assumes
9
9
[ Conditional ( "DEBUG" ) ]
10
10
public static void NotNull < T > ( [ NotNull ] T o ) where T : class ?
11
11
{
12
- Debug . Assert ( o is object , $ "Unexpected null of type { typeof ( T ) . Name } ") ;
12
+ Debug . Assert ( o is not null , $ "Unexpected null value of type { typeof ( T ) . Name } ") ;
13
13
}
14
14
#pragma warning restore CS8777 // Parameter must have a non-null value when exiting.
15
+
16
+ [ Conditional ( "DEBUG" ) ]
17
+ public static void Null < T > ( [ MaybeNull ] T o ) where T : class ?
18
+ {
19
+ Debug . Assert ( o is null , $ "Unexpected non-null value of type { typeof ( T ) . Name } ") ;
20
+ }
15
21
}
16
22
}
You can’t perform that action at this time.
0 commit comments