From 434290120678a0b7e10bd87d45ce80c6622627b7 Mon Sep 17 00:00:00 2001 From: Sinai Date: Fri, 11 Jun 2021 17:36:35 +1000 Subject: [PATCH] Prevent null exceptions being used in ReflectionExToString --- src/Core/Reflection/Extensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;