diff --git a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeClient.cs b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeClient.cs index 63048cb4..195c08b0 100644 --- a/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeClient.cs +++ b/code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeClient.cs @@ -80,11 +80,24 @@ public sealed class DelugeClient public async Task GetTorrentStatus(string hash) { - return await SendRequest( - "web.get_torrent_status", - hash, - Fields - ); + try + { + return await SendRequest( + "web.get_torrent_status", + hash, + Fields + ); + } + catch (DelugeClientException e) + { + // Deluge returns an error when the torrent is not found + if (e.Message == "AttributeError: 'NoneType' object has no attribute 'call'") + { + return null; + } + + throw; + } } public async Task?> GetStatusForAllTorrents()