From ea7c08d21972f5a009f24507787f2c660f48afc4 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 25 Jul 2020 02:32:29 -0400 Subject: [PATCH] Fixed: Don't die in FileNameBuilder when Certification is Null --- src/NzbDrone.Core/Organizer/FileNameBuilder.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index c9c911f4d..e3d14b0de 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -234,8 +234,12 @@ namespace NzbDrone.Core.Organizer tokenHandlers["{Movie Title}"] = m => GetLanguageTitle(movie, m.CustomFormat); tokenHandlers["{Movie CleanTitle}"] = m => CleanTitle(GetLanguageTitle(movie, m.CustomFormat)); tokenHandlers["{Movie Title The}"] = m => TitleThe(movie.Title); - tokenHandlers["{Movie Certification}"] = mbox => movie.Certification; tokenHandlers["{Movie TitleFirstCharacter}"] = m => TitleThe(movie.Title).Substring(0, 1).FirstCharToUpper(); + + if (movie.Certification.IsNotNullOrWhiteSpace()) + { + tokenHandlers["{Movie Certification}"] = mbox => movie.Certification; + }; } private string GetLanguageTitle(Movie movie, string isoCodes)