From b3d498c54326db8f6a3c9cc43f1d6888cbee8e81 Mon Sep 17 00:00:00 2001 From: Alex Mittell Date: Sat, 2 May 2026 16:47:51 -0400 Subject: [PATCH] Fixed: Blocklist add fails when publishedDate is missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DateTime.Parse(null) on the publishedDate value crashed the entire DownloadFailedEvent handler when an indexer omitted that field, preventing the blocklist row from being inserted. Use TryParse and fall back to null — Blocklist.PublishedDate is already DateTime? and the surrounding fields (Size as long?) follow the same pattern of treating missing data as unknown rather than synthesizing a value. Closes #8586 --- src/NzbDrone.Core/Blocklisting/BlocklistService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Blocklisting/BlocklistService.cs b/src/NzbDrone.Core/Blocklisting/BlocklistService.cs index cbea38f6b..c10a745e9 100644 --- a/src/NzbDrone.Core/Blocklisting/BlocklistService.cs +++ b/src/NzbDrone.Core/Blocklisting/BlocklistService.cs @@ -132,7 +132,7 @@ public void Handle(DownloadFailedEvent message) SourceTitle = message.SourceTitle, Quality = message.Quality, Date = DateTime.UtcNow, - PublishedDate = DateTime.Parse(message.Data.GetValueOrDefault("publishedDate")), + PublishedDate = DateTime.TryParse(message.Data.GetValueOrDefault("publishedDate"), out var publishedDate) ? publishedDate : null, Size = long.Parse(message.Data.GetValueOrDefault("size", "0")), Indexer = message.Data.GetValueOrDefault("indexer"), Protocol = (DownloadProtocol)Convert.ToInt32(message.Data.GetValueOrDefault("protocol")),