From beea640d4995ad90d9f6b90f051dafe4878fd6a7 Mon Sep 17 00:00:00 2001 From: Marius Nechifor Date: Tue, 19 Nov 2024 23:02:43 +0200 Subject: [PATCH] fixed content blocker crashing on empty download id (#8) --- .../Verticals/ContentBlocker/ContentBlocker.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/Infrastructure/Verticals/ContentBlocker/ContentBlocker.cs b/code/Infrastructure/Verticals/ContentBlocker/ContentBlocker.cs index ab457fd..3dc497d 100644 --- a/code/Infrastructure/Verticals/ContentBlocker/ContentBlocker.cs +++ b/code/Infrastructure/Verticals/ContentBlocker/ContentBlocker.cs @@ -77,6 +77,12 @@ public sealed class ContentBlocker : IDisposable { foreach (QueueRecord record in items) { + if (string.IsNullOrEmpty(record.DownloadId)) + { + _logger.LogDebug("skip | download id is null for {title}", record.Title); + continue; + } + _logger.LogDebug("searching unwanted files for {title}", record.Title); await _downloadService.BlockUnwantedFilesAsync(record.DownloadId); }