handle null episode title

This commit is contained in:
Luke Pulverenti 2015-11-25 12:13:04 -05:00
parent bf31719373
commit d00954f4eb

View File

@ -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('.');