aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Entities')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs10
-rw-r--r--MediaBrowser.Controller/Entities/Extensions.cs7
-rw-r--r--MediaBrowser.Controller/Entities/PeopleHelper.cs6
3 files changed, 4 insertions, 19 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index b7934bc09..32fe1b3b0 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -1755,10 +1755,7 @@ namespace MediaBrowser.Controller.Entities
/// <exception cref="ArgumentNullException">Throws if name is null.</exception>
public void AddStudio(string name)
{
- if (string.IsNullOrEmpty(name))
- {
- throw new ArgumentNullException(nameof(name));
- }
+ ArgumentException.ThrowIfNullOrEmpty(name);
var current = Studios;
@@ -1791,10 +1788,7 @@ namespace MediaBrowser.Controller.Entities
/// <exception cref="ArgumentNullException">Throwns if name is null.</exception>
public void AddGenre(string name)
{
- if (string.IsNullOrEmpty(name))
- {
- throw new ArgumentNullException(nameof(name));
- }
+ ArgumentException.ThrowIfNullOrEmpty(name);
var genres = Genres;
if (!genres.Contains(name, StringComparison.OrdinalIgnoreCase))
diff --git a/MediaBrowser.Controller/Entities/Extensions.cs b/MediaBrowser.Controller/Entities/Extensions.cs
index d4a779390..3005bee0a 100644
--- a/MediaBrowser.Controller/Entities/Extensions.cs
+++ b/MediaBrowser.Controller/Entities/Extensions.cs
@@ -17,12 +17,7 @@ namespace MediaBrowser.Controller.Entities
/// <param name="url">Trailer URL.</param>
public static void AddTrailerUrl(this BaseItem item, string url)
{
- ArgumentNullException.ThrowIfNull(url);
-
- if (url.Length == 0)
- {
- throw new ArgumentException("String can't be empty", nameof(url));
- }
+ ArgumentException.ThrowIfNullOrEmpty(url);
var current = item.RemoteTrailers.FirstOrDefault(i => string.Equals(i.Url, url, StringComparison.OrdinalIgnoreCase));
diff --git a/MediaBrowser.Controller/Entities/PeopleHelper.cs b/MediaBrowser.Controller/Entities/PeopleHelper.cs
index 44c0e2539..7f8dc069c 100644
--- a/MediaBrowser.Controller/Entities/PeopleHelper.cs
+++ b/MediaBrowser.Controller/Entities/PeopleHelper.cs
@@ -12,11 +12,7 @@ namespace MediaBrowser.Controller.Entities
public static void AddPerson(List<PersonInfo> people, PersonInfo person)
{
ArgumentNullException.ThrowIfNull(person);
-
- if (string.IsNullOrEmpty(person.Name))
- {
- throw new ArgumentException("The person's name was empty or null.", nameof(person));
- }
+ ArgumentException.ThrowIfNullOrEmpty(person.Name);
// Normalize
if (string.Equals(person.Role, PersonType.GuestStar, StringComparison.OrdinalIgnoreCase))