Ver Fonte

Fix nullability errors in Jellyfin.Server

crobibero há 4 anos atrás
pai
commit
6353cb507d
1 ficheiros alterados com 4 adições e 4 exclusões
  1. 4 4
      Jellyfin.Server/Filters/FileResponseFilter.cs

+ 4 - 4
Jellyfin.Server/Filters/FileResponseFilter.cs

@@ -26,22 +26,22 @@ namespace Jellyfin.Server.Filters
                 if (attribute is ProducesFileAttribute producesFileAttribute)
                 if (attribute is ProducesFileAttribute producesFileAttribute)
                 {
                 {
                     // Get operation response values.
                     // Get operation response values.
-                    var (_, value) = operation.Responses
+                    var response = operation.Responses
                         .FirstOrDefault(o => o.Key.Equals(SuccessCode, StringComparison.Ordinal));
                         .FirstOrDefault(o => o.Key.Equals(SuccessCode, StringComparison.Ordinal));
 
 
                     // Operation doesn't have a response.
                     // Operation doesn't have a response.
-                    if (value == null)
+                    if (response.Value == null)
                     {
                     {
                         continue;
                         continue;
                     }
                     }
 
 
                     // Clear existing responses.
                     // Clear existing responses.
-                    value.Content.Clear();
+                    response.Value.Content.Clear();
 
 
                     // Add all content-types as file.
                     // Add all content-types as file.
                     foreach (var contentType in producesFileAttribute.GetContentTypes())
                     foreach (var contentType in producesFileAttribute.GetContentTypes())
                     {
                     {
-                        value.Content.Add(contentType, _openApiMediaType);
+                        response.Value.Content.Add(contentType, _openApiMediaType);
                     }
                     }
 
 
                     break;
                     break;