diff --git a/Mono.Cecil.Cil/PortablePdb.cs b/Mono.Cecil.Cil/PortablePdb.cs index 0ffa1815d..3b61c6851 100644 --- a/Mono.Cecil.Cil/PortablePdb.cs +++ b/Mono.Cecil.Cil/PortablePdb.cs @@ -321,7 +321,10 @@ public void Write () string GetPdbPath () { - var debugHeader = module.Image.DebugHeader; + if (!module.HasDebugHeader) + return string.Empty; + + var debugHeader = module.GetDebugHeader (); foreach (var entry in debugHeader.Entries) { var data = entry.Data; // Pdb path is NUL-terminated path at offset 24.