Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 4342901

Browse files
committed
Prevent null exceptions being used in ReflectionExToString
1 parent 58b7c72 commit 4342901

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Core/Reflection/Extensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ public static string ReflectionExToString(this Exception e, bool innerMost = tru
9999

100100
public static Exception GetInnerMostException(this Exception e)
101101
{
102-
while (e.InnerException != null)
102+
while (e != null)
103103
{
104104
#if CPP
105-
if (e.InnerException is System.Runtime.CompilerServices.RuntimeWrappedException)
105+
if (e.InnerException == null || e.InnerException is System.Runtime.CompilerServices.RuntimeWrappedException)
106106
break;
107107
#endif
108108
e = e.InnerException;

0 commit comments

Comments
 (0)