Fixed potential error when the qbittorrent API fetched info about a torrent that doesn't have a name yet.

This commit is contained in:
Roger Far 2021-10-09 13:35:27 -06:00
parent a15a36ccd9
commit 9947a4dc97

View file

@ -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;