diff --git a/src/Core/Reflection/Extensions.cs b/src/Core/Reflection/Extensions.cs index f948fd5..daaea45 100644 --- a/src/Core/Reflection/Extensions.cs +++ b/src/Core/Reflection/Extensions.cs @@ -99,10 +99,10 @@ namespace UnityExplorer public static Exception GetInnerMostException(this Exception e) { - while (e.InnerException != null) + while (e != null) { #if CPP - if (e.InnerException is System.Runtime.CompilerServices.RuntimeWrappedException) + if (e.InnerException == null || e.InnerException is System.Runtime.CompilerServices.RuntimeWrappedException) break; #endif e = e.InnerException;