mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Fix nullability errors in Jellyfin.Server
This commit is contained in:
parent
445eec7f5f
commit
6353cb507d
@ -26,22 +26,22 @@ namespace Jellyfin.Server.Filters
|
||||
if (attribute is ProducesFileAttribute producesFileAttribute)
|
||||
{
|
||||
// Get operation response values.
|
||||
var (_, value) = operation.Responses
|
||||
var response = operation.Responses
|
||||
.FirstOrDefault(o => o.Key.Equals(SuccessCode, StringComparison.Ordinal));
|
||||
|
||||
// Operation doesn't have a response.
|
||||
if (value == null)
|
||||
if (response.Value == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Clear existing responses.
|
||||
value.Content.Clear();
|
||||
response.Value.Content.Clear();
|
||||
|
||||
// Add all content-types as file.
|
||||
foreach (var contentType in producesFileAttribute.GetContentTypes())
|
||||
{
|
||||
value.Content.Add(contentType, _openApiMediaType);
|
||||
response.Value.Content.Add(contentType, _openApiMediaType);
|
||||
}
|
||||
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user