diff options
| author | Patrick Barron <18354464+barronpm@users.noreply.github.com> | 2020-06-28 23:59:21 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-28 23:59:21 +0000 |
| commit | dbf939467fae7106afc722b31f43bfb950945664 (patch) | |
| tree | 3480b4b94fe002cfd7646b76e7f9f717025d72a2 /Jellyfin.Api/Helpers/RequestHelpers.cs | |
| parent | 9b6daec3ad0004e0af17043518f867d77a4b2612 (diff) | |
| parent | 73bcda7eac6d0785745179fe4b7f58b6bc4ec488 (diff) | |
Merge pull request #3466 from crobibero/api-migration-nullable
Make all optional strings nullable
Diffstat (limited to 'Jellyfin.Api/Helpers/RequestHelpers.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/RequestHelpers.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Jellyfin.Api/Helpers/RequestHelpers.cs b/Jellyfin.Api/Helpers/RequestHelpers.cs index a8ba98f1f..fd86feb8b 100644 --- a/Jellyfin.Api/Helpers/RequestHelpers.cs +++ b/Jellyfin.Api/Helpers/RequestHelpers.cs @@ -20,7 +20,7 @@ namespace Jellyfin.Api.Helpers /// <param name="separator">The char that separates the substrings.</param> /// <param name="removeEmpty">Option to remove empty substrings from the array.</param> /// <returns>An array of the substrings.</returns> - internal static string[] Split(string value, char separator, bool removeEmpty) + internal static string[] Split(string? value, char separator, bool removeEmpty) { if (string.IsNullOrWhiteSpace(value)) { @@ -99,16 +99,14 @@ namespace Jellyfin.Api.Helpers /// <param name="sortBy">Sort by.</param> /// <param name="requestedSortOrder">Sort order.</param> /// <returns>Resulting order by.</returns> - internal static ValueTuple<string, SortOrder>[] GetOrderBy(string sortBy, string requestedSortOrder) + internal static ValueTuple<string, SortOrder>[] GetOrderBy(string? sortBy, string? requestedSortOrder) { - var val = sortBy; - - if (string.IsNullOrEmpty(val)) + if (string.IsNullOrEmpty(sortBy)) { return Array.Empty<ValueTuple<string, SortOrder>>(); } - var vals = val.Split(','); + var vals = sortBy.Split(','); if (string.IsNullOrWhiteSpace(requestedSortOrder)) { requestedSortOrder = "Ascending"; |
