From a3bb0541f00676a32aec65e9aa96e0c0d141c022 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 11 Oct 2023 04:29:20 +0300 Subject: [PATCH] Prevent NullRef on header assert --- src/NzbDrone.Integration.Test/Client/ClientBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NzbDrone.Integration.Test/Client/ClientBase.cs b/src/NzbDrone.Integration.Test/Client/ClientBase.cs index 6f4bb9011..38d0ac5bd 100644 --- a/src/NzbDrone.Integration.Test/Client/ClientBase.cs +++ b/src/NzbDrone.Integration.Test/Client/ClientBase.cs @@ -72,7 +72,7 @@ namespace NzbDrone.Integration.Test.Client { // cache control header gets reordered on net core var headers = response.Headers; - ((string)headers.Single(c => c.Name == "Cache-Control").Value).Split(',').Select(x => x.Trim()) + ((string)headers.SingleOrDefault(c => c.Name == "Cache-Control")?.Value ?? string.Empty).Split(',').Select(x => x.Trim()) .Should().BeEquivalentTo("no-store, no-cache".Split(',').Select(x => x.Trim())); headers.Single(c => c.Name == "Pragma").Value.Should().Be("no-cache"); headers.Single(c => c.Name == "Expires").Value.Should().Be("-1");