From 3fe7c3de1a36a12fb0b7b06e6c7655b4fef59345 Mon Sep 17 00:00:00 2001 From: Flaminel Date: Sun, 16 Feb 2025 03:37:50 +0200 Subject: [PATCH] added null check for torrent properties --- .../Verticals/DownloadClient/QBittorrent/QBitService.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitService.cs b/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitService.cs index f1c2d67..fe8d6d8 100644 --- a/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitService.cs +++ b/code/Infrastructure/Verticals/DownloadClient/QBittorrent/QBitService.cs @@ -245,6 +245,12 @@ public class QBitService : DownloadService, IQBitService { TorrentProperties? torrentProperties = await _client.GetTorrentPropertiesAsync(download.Hash); + if (torrentProperties is null) + { + _logger.LogDebug("failed to find torrent properties in the download client | {name}", download.Name); + return; + } + bool isPrivate = torrentProperties.AdditionalData.TryGetValue("is_private", out var dictValue) && bool.TryParse(dictValue?.ToString(), out bool boolValue) && boolValue;