Prevent null exceptions being used in ReflectionExToString

This commit is contained in:
Sinai
2021-06-11 17:36:35 +10:00
parent 58b7c72a5c
commit 4342901206

View File

@ -99,10 +99,10 @@ namespace UnityExplorer
public static Exception GetInnerMostException(this Exception e) public static Exception GetInnerMostException(this Exception e)
{ {
while (e.InnerException != null) while (e != null)
{ {
#if CPP #if CPP
if (e.InnerException is System.Runtime.CompilerServices.RuntimeWrappedException) if (e.InnerException == null || e.InnerException is System.Runtime.CompilerServices.RuntimeWrappedException)
break; break;
#endif #endif
e = e.InnerException; e = e.InnerException;