Skip to content

Commit 3e48fe1

Browse files
committed
use string.IsNullOrEmpty(s) to check the input pattern string
`s.IsNullOrEmpty()` throws a NPE without the message. use `string.IsNullOrEmpty(s)` to check for nullness and emptiness, so the next line of code gets to run.
1 parent 1dc8be7 commit 3e48fe1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Parakeet/Rule.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public class CaseInvariantStringRule : Rule
214214

215215
public CaseInvariantStringRule(string s)
216216
{
217-
if (s.IsNullOrEmpty())
217+
if (string.IsNullOrEmpty(s))
218218
throw new ArgumentException("Pattern must be non-empty", nameof(s));
219219
Pattern = s;
220220
}

0 commit comments

Comments
 (0)