diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-10-13 19:08:00 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-12-07 16:43:59 +0100 |
| commit | b366dc2e6e5be2b93f2b6fcc4549a32b655c3806 (patch) | |
| tree | 8f7ee8407e31e58db9aabe74bfc21936275ec45e /Emby.Server.Implementations/Library/LibraryManager.cs | |
| parent | 93fd462b581207d937c5d4eb939b1cc96c86c1f2 (diff) | |
Use ArgumentException.ThrowIfNullOrEmpty
Diffstat (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 9ee8a630d..70439d258 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -495,11 +495,7 @@ namespace Emby.Server.Implementations.Library private Guid GetNewItemIdInternal(string key, Type type, bool forceCaseInsensitive) { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException(nameof(key)); - } - + ArgumentException.ThrowIfNullOrEmpty(key); ArgumentNullException.ThrowIfNull(type); string programDataPath = _configurationManager.ApplicationPaths.ProgramDataPath; @@ -818,10 +814,7 @@ namespace Emby.Server.Implementations.Library { // If this returns multiple items it could be tricky figuring out which one is correct. // In most cases, the newest one will be and the others obsolete but not yet cleaned up - if (string.IsNullOrEmpty(path)) - { - throw new ArgumentNullException(nameof(path)); - } + ArgumentException.ThrowIfNullOrEmpty(path); var query = new InternalItemsQuery { @@ -2340,10 +2333,7 @@ namespace Emby.Server.Implementations.Library string sortName, string uniqueId) { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException(nameof(name)); - } + ArgumentException.ThrowIfNullOrEmpty(name); var parentIdString = parentId.Equals(default) ? null @@ -3125,10 +3115,7 @@ namespace Emby.Server.Implementations.Library public void RemoveMediaPath(string virtualFolderName, string mediaPath) { - if (string.IsNullOrEmpty(mediaPath)) - { - throw new ArgumentNullException(nameof(mediaPath)); - } + ArgumentException.ThrowIfNullOrEmpty(mediaPath); var rootFolderPath = _configurationManager.ApplicationPaths.DefaultUserViewsPath; var virtualFolderPath = Path.Combine(rootFolderPath, virtualFolderName); |
