diff --git a/CHANGE-LOG.md b/CHANGE-LOG.md index 120db4cc..ab20440d 100644 --- a/CHANGE-LOG.md +++ b/CHANGE-LOG.md @@ -1,5 +1,9 @@ # Full Change Log for Raygun4Net.* packages +### v11.1.1 +- Prevented a null reference exception from being thrown after a PortableExecutable (PE) fails to be loaded from disk + - See: https://github.com/MindscapeHQ/raygun4net/pull/544 + ### v11.1.0 - Fix issue with `RaygunClientBase` where `SendInBackground` deferred building the message until late, losing HttpContext - See: https://github.com/MindscapeHQ/raygun4net/pull/540 diff --git a/Mindscape.Raygun4Net.Core/Diagnostics/PortableExecutableReaderExtensions.cs b/Mindscape.Raygun4Net.Core/Diagnostics/PortableExecutableReaderExtensions.cs index 71f7c0da..3ab8ac2d 100644 --- a/Mindscape.Raygun4Net.Core/Diagnostics/PortableExecutableReaderExtensions.cs +++ b/Mindscape.Raygun4Net.Core/Diagnostics/PortableExecutableReaderExtensions.cs @@ -26,6 +26,12 @@ public static PEReader GetFileSystemPEReader(string moduleName) public static bool TryGetDebugInformation(this PEReader peReader, out PEDebugInformation debugInformation) { + if (peReader is null) + { + debugInformation = null; + return false; + } + try { debugInformation = GetDebugInformation(peReader); diff --git a/Mindscape.Raygun4Net.NetCore.Common/Diagnostics/PortableExecutableReaderExtensions.cs b/Mindscape.Raygun4Net.NetCore.Common/Diagnostics/PortableExecutableReaderExtensions.cs index b1d56302..af6d95b8 100644 --- a/Mindscape.Raygun4Net.NetCore.Common/Diagnostics/PortableExecutableReaderExtensions.cs +++ b/Mindscape.Raygun4Net.NetCore.Common/Diagnostics/PortableExecutableReaderExtensions.cs @@ -26,8 +26,14 @@ internal static class PortableExecutableReaderExtensions } } - public static bool TryGetDebugInformation(this PEReader peReader, out PEDebugInformation? debugInformation) + public static bool TryGetDebugInformation(this PEReader? peReader, out PEDebugInformation? debugInformation) { + if (peReader is null) + { + debugInformation = null; + return false; + } + try { debugInformation = GetDebugInformation(peReader);