From 763ce5a03656fdbc50c5c42238aee7ad1f17d432 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Wed, 24 Nov 2021 07:59:14 -0700 Subject: [PATCH] Fixed potential issue with the RealDebrid data mapper. --- .../TorrentClients/RealDebridTorrentClient.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs index 29528c3..7698a92 100644 --- a/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs @@ -224,8 +224,18 @@ namespace RdtClient.Service.Services.TorrentClients { try { + if (torrent == null) + { + return null; + } + var rdTorrent = await GetInfo(torrent.RdId); + if (rdTorrent == null) + { + return torrent; + } + if (!String.IsNullOrWhiteSpace(rdTorrent.Filename)) { torrent.RdName = rdTorrent.Filename; @@ -279,7 +289,10 @@ namespace RdtClient.Service.Services.TorrentClients { if (ex.Message == "Resource not found") { - torrent.RdStatusRaw = "deleted"; + if (torrent != null) + { + torrent.RdStatusRaw = "deleted"; + } } else {