From 8c68dfb8ceb5d151b71fbd1af6ee0c2e404aa083 Mon Sep 17 00:00:00 2001 From: ta264 Date: Mon, 24 Jan 2022 21:13:20 +0000 Subject: [PATCH] Fixed: Handle missing category when getting Qbittorrent download path Fixes RADARR-7HC Fixes RADARR-V49 (cherry picked from commit 6f97ca9a55471386454457ca52b93733e18e85e4) (cherry picked from commit e7a8f6332c43f179d4c95b3a8a0253a235bb6eec) --- .../Download/Clients/QBittorrent/QBittorrent.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs index 945648270..2aba58252 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs @@ -367,9 +367,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent if (Settings.TvCategory.IsNotNullOrWhiteSpace() && version >= Version.Parse("2.0")) { - var label = Proxy.GetLabels(Settings)[Settings.TvCategory]; - - if (label.SavePath.IsNotNullOrWhiteSpace()) + if (Proxy.GetLabels(Settings).TryGetValue(Settings.TvCategory, out var label) && label.SavePath.IsNotNullOrWhiteSpace()) { var labelDir = new OsPath(label.SavePath); @@ -474,9 +472,9 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent _logger.Error(ex, "Unable to test qBittorrent"); return new NzbDroneValidationFailure("Host", "Unable to connect to qBittorrent") - { - DetailedDescription = ex.Message - }; + { + DetailedDescription = ex.Message + }; } return null;