diff options
| author | Bond-009 <bond.009@outlook.com> | 2022-12-07 17:17:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-07 17:17:37 +0100 |
| commit | 584c80e323ac2a1386d86ff9f59e50daf174418e (patch) | |
| tree | 4dbb2861cb79cf418a76a4b8f364fdc5c62b56f7 /MediaBrowser.Controller/Library | |
| parent | f3c57e6a0ae015dc51cf548a0380d1bed33959c2 (diff) | |
| parent | 227aa0540bf0d6c00848b0efb8a5e0ece86c7412 (diff) | |
Merge pull request #8547 from Bond-009/net7
Diffstat (limited to 'MediaBrowser.Controller/Library')
| -rw-r--r-- | MediaBrowser.Controller/Library/ItemResolveArgs.cs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.cs index 0424399c8..01986d303 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -171,10 +171,7 @@ namespace MediaBrowser.Controller.Library /// <exception cref="ArgumentNullException"><paramref name="path"/> is <c>null</c> or empty.</exception> public void AddAdditionalLocation(string path) { - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentException("The path was empty or null.", nameof(path)); - } + ArgumentException.ThrowIfNullOrEmpty(path); AdditionalLocations ??= new List<string>(); AdditionalLocations.Add(path); @@ -190,10 +187,7 @@ namespace MediaBrowser.Controller.Library /// <exception cref="ArgumentNullException"><paramref name="name"/> is <c>null</c> or empty.</exception> public FileSystemMetadata GetFileSystemEntryByName(string name) { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentException("The name was empty or null.", nameof(name)); - } + ArgumentException.ThrowIfNullOrEmpty(name); return GetFileSystemEntryByPath(System.IO.Path.Combine(Path, name)); } @@ -206,10 +200,7 @@ namespace MediaBrowser.Controller.Library /// <exception cref="ArgumentNullException">Throws if path is invalid.</exception> public FileSystemMetadata GetFileSystemEntryByPath(string path) { - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentException("The path was empty or null.", nameof(path)); - } + ArgumentException.ThrowIfNullOrEmpty(path); foreach (var file in FileSystemChildren) { |
