Skip to content

Commit

Permalink
fix: don't assume directory name is not nullable
Browse files Browse the repository at this point in the history
since it can be null.
  • Loading branch information
revam committed Oct 10, 2024
1 parent 88e0a0f commit 36043df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Shoko.Server/Renamer/RenameFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ private static RelocationResult UnAbstractResult(SVR_VideoLocal_Place place, Abs

var newImportFolder = shouldMove && !result.SkipMove ? result.DestinationImportFolder! : place.ImportFolder!;
var newFileName = shouldRename && !result.SkipRename ? result.FileName! : place.FileName;
var newRelativeDirectory = shouldMove && !result.SkipMove ? result.Path! : Path.GetDirectoryName(place.FilePath)!;
var newRelativePath = newRelativeDirectory.Length > 0 ? Path.Combine(newRelativeDirectory, newFileName) : newFileName;
var newRelativeDirectory = shouldMove && !result.SkipMove ? result.Path : Path.GetDirectoryName(place.FilePath);
var newRelativePath = !string.IsNullOrEmpty(newRelativeDirectory) && newRelativeDirectory.Length > 0 ? Path.Combine(newRelativeDirectory, newFileName) : newFileName;
var newFullPath = Path.Combine(newImportFolder.Path, newRelativePath);
return new()
{
Expand Down

0 comments on commit 36043df

Please sign in to comment.