Skip to content

Commit 683ece8

Browse files
committed
avoid trying to get dirname of null
1 parent 9ed0764 commit 683ece8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

NetcodePatcher/CodeGen/NetcodeILPPApplicator.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,23 @@ public void ApplyProcesses()
8181
// remove files with _original.dll and _original.pdb
8282

8383
renameAssemblyPath = Path.Combine(AssemblyDirName, $"{AssemblyName}_original.dll");
84-
renamePdbPath = Path.Combine(Path.GetDirectoryName(pdbPath)!, $"{Path.GetFileNameWithoutExtension(pdbPath)}_original.pdb");
85-
8684
if (File.Exists(renameAssemblyPath))
8785
{
8886
Log.Information("Deleting : {FileName}", Path.GetFileName(renameAssemblyPath));
8987
File.Delete(renameAssemblyPath);
9088
}
91-
92-
if (File.Exists(renamePdbPath))
93-
{
94-
Log.Information("Deleting : {FileName}", Path.GetFileName(renamePdbPath));
95-
File.Delete(renamePdbPath);
96-
}
97-
9889
File.Move(AssemblyPath, renameAssemblyPath);
90+
9991
if (pdbPath is not null)
92+
{
93+
renamePdbPath = Path.Combine(Path.GetDirectoryName(pdbPath)!, $"{Path.GetFileNameWithoutExtension(pdbPath)}_original.pdb");
94+
if (File.Exists(renamePdbPath))
95+
{
96+
Log.Information("Deleting : {FileName}", Path.GetFileName(renamePdbPath));
97+
File.Delete(renamePdbPath);
98+
}
10099
File.Move(pdbPath, renamePdbPath);
100+
}
101101
}
102102

103103
ICompiledAssembly ApplyProcess<TProcessor>(ICompiledAssembly assemblyToApplyProcessTo)

0 commit comments

Comments
 (0)