From fa9c839be082e2adbeebe54308180d2f4a0bb096 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Wed, 9 Jun 2021 17:39:30 -0600 Subject: [PATCH] Fixed rare issue where the download link would be empty or invalid. --- server/RdtClient.Service/Services/TorrentRunner.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/RdtClient.Service/Services/TorrentRunner.cs b/server/RdtClient.Service/Services/TorrentRunner.cs index 8bf8936..0cd1c7c 100644 --- a/server/RdtClient.Service/Services/TorrentRunner.cs +++ b/server/RdtClient.Service/Services/TorrentRunner.cs @@ -237,8 +237,16 @@ namespace RdtClient.Service.Services continue; } - var downloadLink = await _torrents.UnrestrictLink(download.DownloadId); - download.Link = downloadLink; + try + { + var downloadLink = await _torrents.UnrestrictLink(download.DownloadId); + download.Link = downloadLink; + } + catch (Exception ex) + { + await _downloads.UpdateError(download.DownloadId, ex.Message); + continue; + } download.DownloadStarted = DateTime.UtcNow; await _downloads.UpdateDownloadStarted(download.DownloadId, download.DownloadStarted);