Prevent Unity crashing on PropertyInfo evaluation

Unity crashes from checking Canvas.renderingDisplaySize on a Canvas set to WorldSpace with no worldCamera set.
This commit is contained in:
Sinai
2022-02-19 17:50:10 +11:00
parent d0bccae50c
commit a90292f47f
5 changed files with 36 additions and 8 deletions

View File

@ -3,7 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using UnityEngine;
using UnityExplorer.Inspectors;
using UnityExplorer.Runtime;
namespace UnityExplorer.CacheObject
{
@ -28,6 +30,8 @@ namespace UnityExplorer.CacheObject
{
try
{
UnityCrashPrevention.CheckPropertyInfoEvaluation(this);
object ret;
if (HasArguments)
ret = PropertyInfo.GetValue(DeclaringInstance, this.Evaluator.TryParseArguments());