mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-31 21:08:27 +01:00
Code Clean up: Convert to null-coalescing operator ?? (#5845)
Co-authored-by: Cody Robibero <cody@robibe.ro> Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
This commit is contained in:
@@ -45,10 +45,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
if (copy.RefreshPaths != null && copy.RefreshPaths.Length > 0)
|
||||
{
|
||||
if (RefreshPaths == null)
|
||||
{
|
||||
RefreshPaths = Array.Empty<string>();
|
||||
}
|
||||
RefreshPaths ??= Array.Empty<string>();
|
||||
|
||||
RefreshPaths = copy.RefreshPaths.ToArray();
|
||||
}
|
||||
|
||||
@@ -37,10 +37,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
public void AddPerson(PersonInfo p)
|
||||
{
|
||||
if (People == null)
|
||||
{
|
||||
People = new List<PersonInfo>();
|
||||
}
|
||||
People ??= new List<PersonInfo>();
|
||||
|
||||
PeopleHelper.AddPerson(People, p);
|
||||
}
|
||||
@@ -54,16 +51,15 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
People = new List<PersonInfo>();
|
||||
}
|
||||
|
||||
People.Clear();
|
||||
else
|
||||
{
|
||||
People.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public UserItemData GetOrAddUserData(string userId)
|
||||
{
|
||||
if (UserDataList == null)
|
||||
{
|
||||
UserDataList = new List<UserItemData>();
|
||||
}
|
||||
UserDataList ??= new List<UserItemData>();
|
||||
|
||||
UserItemData userData = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user