@@ -43,13 +43,13 @@ public static void IsNotNullOrEmpty([NotNull] string? text, string name)
43
43
{
44
44
if ( ! string . IsNullOrEmpty ( text ) )
45
45
{
46
+ #pragma warning disable CS8777 // Does not return when text is null
46
47
return ;
48
+ #pragma warning restore CS8777
47
49
}
48
50
49
51
ThrowHelper . ThrowArgumentExceptionForIsNotNullOrEmpty ( text , name ) ;
50
- #pragma warning disable CS8777 // Does not return when text is null (.NET Standard 2.0 string.IsNullOrEmpty lacks flow attribute)
51
52
}
52
- #pragma warning restore CS8777
53
53
54
54
/// <summary>
55
55
/// Asserts that the input <see cref="string"/> instance must be <see langword="null"/> or whitespace.
@@ -97,13 +97,13 @@ public static void IsNotNullOrWhiteSpace([NotNull] string? text, string name)
97
97
{
98
98
if ( ! string . IsNullOrWhiteSpace ( text ) )
99
99
{
100
+ #pragma warning disable CS8777 // Does not return when text is null
100
101
return ;
102
+ #pragma warning restore CS8777
101
103
}
102
104
103
105
ThrowHelper . ThrowArgumentExceptionForIsNotNullOrWhiteSpace ( text , name ) ;
104
- #pragma warning disable CS8777 // Does not return when text is null
105
106
}
106
- #pragma warning restore CS8777
107
107
108
108
/// <summary>
109
109
/// Asserts that the input <see cref="string"/> instance must not be <see langword="null"/> or whitespace.
@@ -117,13 +117,13 @@ public static void IsNotNullOrWhitespace([NotNull] string? text, string name)
117
117
{
118
118
if ( ! string . IsNullOrWhiteSpace ( text ) )
119
119
{
120
+ #pragma warning disable CS8777 // Does not return when text is null
120
121
return ;
122
+ #pragma warning restore CS8777
121
123
}
122
124
123
125
ThrowHelper . ThrowArgumentExceptionForIsNotNullOrWhiteSpace ( text , name ) ;
124
- #pragma warning disable CS8777 // Does not return when text is null
125
126
}
126
- #pragma warning restore CS8777
127
127
128
128
/// <summary>
129
129
/// Asserts that the input <see cref="string"/> instance must be empty.
0 commit comments