From 9947a4dc97a3288c6d6b9ae7e823697e6d46c82f Mon Sep 17 00:00:00 2001 From: Roger Far Date: Sat, 9 Oct 2021 13:35:27 -0600 Subject: [PATCH] Fixed potential error when the qbittorrent API fetched info about a torrent that doesn't have a name yet. --- server/RdtClient.Service/Services/QBittorrent.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/RdtClient.Service/Services/QBittorrent.cs b/server/RdtClient.Service/Services/QBittorrent.cs index f5d5625..995f8fc 100644 --- a/server/RdtClient.Service/Services/QBittorrent.cs +++ b/server/RdtClient.Service/Services/QBittorrent.cs @@ -226,7 +226,11 @@ namespace RdtClient.Service.Services downloadPath = Path.Combine(downloadPath, torrent.Category); } - var torrentPath = Path.Combine(downloadPath, torrent.RdName) + Path.DirectorySeparatorChar; + var torrentPath = downloadPath; + if (!String.IsNullOrWhiteSpace(torrent.RdName)) + { + torrentPath = Path.Combine(downloadPath, torrent.RdName) + Path.DirectorySeparatorChar; + } var bytesDone = torrent.RdProgress; var bytesTotal = torrent.RdSize;