From 91ba4f003a92f1e4850195853113772e2e4b2fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20H=C3=BCter?= Date: Thu, 25 Aug 2022 13:48:52 +0200 Subject: [PATCH] Add null checks to diagnostics helper functions --- .../Plugins/UniTask/Runtime/PlayerLoopHelper.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs index 3c605a4..dd49df0 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs @@ -524,11 +524,19 @@ namespace Cysharp.Threading.Tasks { sb.AppendFormat("------{0}------", header.type.Name); sb.AppendLine(); + + if (header.subSystemList is null) + { + sb.AppendFormat("{0} has no subsystems!", header.ToString()); + sb.AppendLine(); + continue; + } + foreach (var subSystem in header.subSystemList) { sb.AppendFormat("{0}", subSystem.type.Name); sb.AppendLine(); - + if (subSystem.subSystemList != null) { UnityEngine.Debug.LogWarning("More Subsystem:" + subSystem.subSystemList.Length); @@ -545,6 +553,11 @@ namespace Cysharp.Threading.Tasks foreach (var header in playerLoop.subSystemList) { + if (header.subSystemList is null) + { + continue; + } + foreach (var subSystem in header.subSystemList) { if (subSystem.type == typeof(UniTaskLoopRunners.UniTaskLoopRunnerInitialization))