From e8675a6c24ebb86ce4a48f208f439f42267bf8e6 Mon Sep 17 00:00:00 2001 From: crobibero Date: Fri, 13 Nov 2020 09:03:44 -0700 Subject: Fix nullability errors in Jellyfin.Server --- Jellyfin.Server/Formatters/XmlOutputFormatter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Jellyfin.Server/Formatters/XmlOutputFormatter.cs') diff --git a/Jellyfin.Server/Formatters/XmlOutputFormatter.cs b/Jellyfin.Server/Formatters/XmlOutputFormatter.cs index 01d99d7c8..be0baea2d 100644 --- a/Jellyfin.Server/Formatters/XmlOutputFormatter.cs +++ b/Jellyfin.Server/Formatters/XmlOutputFormatter.cs @@ -26,7 +26,8 @@ namespace Jellyfin.Server.Formatters /// public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding) { - return context.HttpContext.Response.WriteAsync(context.Object?.ToString()); + var stringResponse = context.Object?.ToString(); + return stringResponse == null ? Task.CompletedTask : context.HttpContext.Response.WriteAsync(stringResponse); } } } -- cgit v1.2.3