From fc06e5135213f218648c8b36747d3bdf361f08b4 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 10 Apr 2024 02:13:59 +0300 Subject: [PATCH] Fixed: Renaming episodes for a series Closes #6640 --- src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs index e186246ba..2518df234 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs @@ -122,7 +122,11 @@ namespace NzbDrone.Core.MediaFiles } episodeFile.RelativePath = series.Path.GetRelativePath(destinationFilePath); - localEpisode.FileNameBeforeRename = episodeFile.RelativePath; + + if (localEpisode is not null) + { + localEpisode.FileNameBeforeRename = episodeFile.RelativePath; + } if (localEpisode is not null && _scriptImportDecider.TryImport(episodeFilePath, destinationFilePath, localEpisode, episodeFile, mode) is var scriptImportDecision && scriptImportDecision != ScriptImportDecision.DeferMove) {