Skip to content

Commit

Permalink
Merge pull request #544 from MindscapeHQ/jp/prevent-exception-getting…
Browse files Browse the repository at this point in the history
…-debug-information

Prevent exception from being thrown and then immediately caught when getting debug information
  • Loading branch information
JasenPalmer authored Sep 12, 2024
2 parents a7a45a4 + e0dd16a commit 39ef02c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGE-LOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 39ef02c

Please sign in to comment.