mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-28 11:44:48 +03:00
Fix nullability errors in Jellyfin.Api (part 1)
This commit is contained in:
@@ -210,9 +210,9 @@ namespace MediaBrowser.Model.Net
|
||||
return enableStreamDefault ? "application/octet-stream" : null;
|
||||
}
|
||||
|
||||
public static string? ToExtension(string mimeType)
|
||||
public static string? ToExtension(string? mimeType)
|
||||
{
|
||||
if (mimeType.Length == 0)
|
||||
if (string.IsNullOrEmpty(mimeType))
|
||||
{
|
||||
throw new ArgumentException("String can't be empty.", nameof(mimeType));
|
||||
}
|
||||
@@ -220,7 +220,7 @@ namespace MediaBrowser.Model.Net
|
||||
// handle text/html; charset=UTF-8
|
||||
mimeType = mimeType.Split(';')[0];
|
||||
|
||||
if (_extensionLookup.TryGetValue(mimeType, out string result))
|
||||
if (_extensionLookup.TryGetValue(mimeType, out string? result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user