diff options
| author | crobibero <cody@robibe.ro> | 2020-06-27 10:50:44 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-06-27 10:50:44 -0600 |
| commit | 73bcda7eac6d0785745179fe4b7f58b6bc4ec488 (patch) | |
| tree | d1d6841d78432b95f1e2342e5632d5feb75ae1ee /Jellyfin.Api/Helpers/RequestHelpers.cs | |
| parent | 90c01327aa3ea52a2b9a47f00ede9d887399e3d9 (diff) | |
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"; |
