mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-08 13:01:10 +02:00
Fixed: Blocklist add fails when publishedDate is missing
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
This commit is contained in:
parent
bf5d48c76a
commit
b3d498c543
1 changed files with 1 additions and 1 deletions
|
|
@ -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")),
|
||||
|
|
|
|||
Loading…
Reference in a new issue