Skip to content

Commit

Permalink
Fix some nullability issues from previous commit for dotnet#77835
Browse files Browse the repository at this point in the history
• Fix nullability issues
  • Loading branch information
hamarb123 committed Dec 6, 2022
1 parent 5377efb commit 8d8328a
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@ public static partial void CopyFile(string sourceFullPath, string destFullPath,
//Simplify the destination path (i.e. unlink all the links except the last one itself,
//i.e. for /link1/link2, you could get /folder1/link2).
string destFullPath_Full = Path.GetFullPath(destFullPath);
string destPath = Path.GetDirectoryName(destFullPath_Full);
destPath = ResolveLinkTargetString(destPath, true, true);
string? destPathFolder = Path.GetDirectoryName(destFullPath_Full);
string destPath;
if (string.IsNullOrEmpty(destPath))
{
destPath = destFullPath_Full;
}
else
{
destPath = Path.Combine(destPath, Path.GetFileName(destFullPath));
destPathFolder = ResolveLinkTargetString(destPathFolder, true, true);
if (string.IsNullOrEmpty(destPath))
{
destPath = destFullPath_Full;
}
else
{
destPath = Path.Combine(destPathFolder, Path.GetFileName(destFullPath));
}
}

//Get the full path of the source path and verify that we're not copying the source file onto itself
Expand Down

0 comments on commit 8d8328a

Please sign in to comment.