mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-05-03 02:00:59 +02:00
Prevent NullRef in ContainsInvalidPathChars
(cherry picked from commit 5f7217844533907d7fc6287a48efb31987736c4c)
This commit is contained in:
parent
c93d6cff63
commit
0bfb557470
1 changed files with 5 additions and 0 deletions
|
|
@ -158,6 +158,11 @@ public static bool IsPathValid(this string path, PathValidationType validationTy
|
|||
|
||||
public static bool ContainsInvalidPathChars(this string text)
|
||||
{
|
||||
if (text.IsNullOrWhiteSpace())
|
||||
{
|
||||
throw new ArgumentNullException("text");
|
||||
}
|
||||
|
||||
return text.IndexOfAny(Path.GetInvalidPathChars()) >= 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue