diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index 1343a7bc7..3dfcc44dc 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -240,7 +240,7 @@ namespace NzbDrone.Core.Organizer tokenHandlers["{Author Name}"] = m => author.Name; tokenHandlers["{Author CleanName}"] = m => CleanTitle(author.Name); tokenHandlers["{Author NameThe}"] = m => TitleThe(author.Name); - tokenHandlers["{Author SortName}"] = m => author.Metadata.Value.NameLastFirst; + tokenHandlers["{Author SortName}"] = m => author?.Metadata?.Value?.NameLastFirst ?? string.Empty; tokenHandlers["{Author NameFirstCharacter}"] = m => TitleThe(author.Name).Substring(0, 1).FirstCharToUpper(); if (author.Metadata.Value.Disambiguation != null) diff --git a/src/NzbDrone.Core/Organizer/FileNameSampleService.cs b/src/NzbDrone.Core/Organizer/FileNameSampleService.cs index fd87436bf..e89ba1351 100644 --- a/src/NzbDrone.Core/Organizer/FileNameSampleService.cs +++ b/src/NzbDrone.Core/Organizer/FileNameSampleService.cs @@ -34,7 +34,8 @@ namespace NzbDrone.Core.Organizer Metadata = new AuthorMetadata { Name = "The Author Name", - Disambiguation = "US Author" + Disambiguation = "US Author", + NameLastFirst = "Last name, First name" } };