diff options
| author | softworkz <softworkz@hotmail.com> | 2015-11-01 19:24:45 +0100 |
|---|---|---|
| committer | softworkz <softworkz@hotmail.com> | 2015-11-01 19:35:36 +0100 |
| commit | c4aa744605d078f8ea5aa801e452df539cab7613 (patch) | |
| tree | ae94e70de85cdd4e1cfd7344f895666443ee4cb5 | |
| parent | a5f2e21ca4feeacfa5afa88d20ae90f51b794593 (diff) | |
Fix exception when episode title is null
Sometimes TheTVDb does not have episode. This caused an exception in
EpisodeFileOrganizer
| -rw-r--r-- | MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs index e36813d11..ef226a934 100644 --- a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs +++ b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs @@ -504,7 +504,15 @@ namespace MediaBrowser.Server.Implementations.FileOrganization private string GetEpisodeFileName(string sourcePath, string seriesName, int seasonNumber, int episodeNumber, int? endingEpisodeNumber, string episodeTitle, TvFileOrganizationOptions options, int? maxLength) { seriesName = _fileSystem.GetValidFilename(seriesName).Trim(); - episodeTitle = _fileSystem.GetValidFilename(episodeTitle).Trim(); + + if (episodeTitle == null) + { + episodeTitle = string.Empty; + } + else + { + episodeTitle = _fileSystem.GetValidFilename(episodeTitle).Trim(); + } var sourceExtension = (Path.GetExtension(sourcePath) ?? string.Empty).TrimStart('.'); |
