From 0145c116f19235cf130e70c64df92134e3f86283 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Thu, 9 Feb 2017 08:04:42 +0000 Subject: [PATCH] Fixed #1083 --- Ombi.UI/Modules/RequestsModule.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Ombi.UI/Modules/RequestsModule.cs b/Ombi.UI/Modules/RequestsModule.cs index 29ffe20f1..d99241e98 100644 --- a/Ombi.UI/Modules/RequestsModule.cs +++ b/Ombi.UI/Modules/RequestsModule.cs @@ -299,8 +299,18 @@ namespace Ombi.UI.Modules return r.path; } - // Return default path - return rootFoldersResult.FirstOrDefault(x => x.id.Equals(int.Parse(sonarrSettings.RootPath)))?.path ?? string.Empty; + int outRoot; + var defaultPath = int.TryParse(sonarrSettings.RootPath, out outRoot); + + if (defaultPath) + { + // Return default path + return rootFoldersResult.FirstOrDefault(x => x.id.Equals(outRoot)?.path ?? string.Empty; + } + else + { + return rootFoldersResult.FirstOrDefault()?.path ?? string.Empty; + } } private async Task GetAlbumRequests()