mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-08 13:01:10 +02:00
Improve nullable analysis for IsNullOrWhiteSpace and IsNotNullOrWhiteSpace
This commit is contained in:
parent
bf5d48c76a
commit
f639ac0c8d
2 changed files with 6 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
|
@ -93,15 +94,17 @@ public static string CleanSpaces(this string text)
|
|||
return CollapseSpace.Replace(text, " ").Trim();
|
||||
}
|
||||
|
||||
public static bool IsNullOrWhiteSpace(this string text)
|
||||
#nullable enable
|
||||
public static bool IsNullOrWhiteSpace([NotNullWhen(false)] this string? text)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(text);
|
||||
}
|
||||
|
||||
public static bool IsNotNullOrWhiteSpace(this string text)
|
||||
public static bool IsNotNullOrWhiteSpace([NotNullWhen(true)] this string? text)
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(text);
|
||||
}
|
||||
#nullable disable
|
||||
|
||||
public static bool StartsWithIgnoreCase(this string text, string startsWith)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ protected override bool IsValid(PropertyValidatorContext context)
|
|||
return true;
|
||||
}
|
||||
|
||||
var rootFolder = new DirectoryInfo(rootFolderPath!).Name;
|
||||
var rootFolder = new DirectoryInfo(rootFolderPath).Name;
|
||||
var series = seriesResource.ToModel();
|
||||
var seriesFolder = _fileNameBuilder.GetSeriesFolder(series);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue