diff options
| author | crobibero <cody@robibe.ro> | 2020-07-07 09:10:51 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-07-07 09:10:51 -0600 |
| commit | 5d34b07d1ff7239c7961381fc71559d377e7a96b (patch) | |
| tree | 405408d5cd266b25fc3182951592ce912b0286fd /Jellyfin.Api/Controllers/FilterController.cs | |
| parent | 2eef7d49131d717a0752cf3dcab1922637e2ef98 (diff) | |
Make query parameters nullable or set default value
Diffstat (limited to 'Jellyfin.Api/Controllers/FilterController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/FilterController.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Jellyfin.Api/Controllers/FilterController.cs b/Jellyfin.Api/Controllers/FilterController.cs index 8a0a6ad86..288d4c545 100644 --- a/Jellyfin.Api/Controllers/FilterController.cs +++ b/Jellyfin.Api/Controllers/FilterController.cs @@ -57,9 +57,9 @@ namespace Jellyfin.Api.Controllers ? null : _libraryManager.GetItemById(parentId); - var user = userId == null || userId == Guid.Empty - ? null - : _userManager.GetUserById(userId.Value); + var user = userId.HasValue && !userId.Equals(Guid.Empty) + ? _userManager.GetUserById(userId.Value) + : null; if (string.Equals(includeItemTypes, nameof(BoxSet), StringComparison.OrdinalIgnoreCase) || string.Equals(includeItemTypes, nameof(Playlist), StringComparison.OrdinalIgnoreCase) @@ -152,9 +152,9 @@ namespace Jellyfin.Api.Controllers ? null : _libraryManager.GetItemById(parentId); - var user = userId == null || userId == Guid.Empty - ? null - : _userManager.GetUserById(userId.Value); + var user = userId.HasValue && !userId.Equals(Guid.Empty) + ? _userManager.GetUserById(userId.Value) + : null; if (string.Equals(includeItemTypes, nameof(BoxSet), StringComparison.OrdinalIgnoreCase) || string.Equals(includeItemTypes, nameof(Playlist), StringComparison.OrdinalIgnoreCase) |
