From b72bef527be331463ff2a33188005cd375f03616 Mon Sep 17 00:00:00 2001 From: tanghai Date: Mon, 22 Mar 2021 21:44:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E4=B8=8A=E5=89=A9=E4=B8=8B=E5=87=A0?= =?UTF-8?q?=E4=B8=AAwaitall=E7=9A=84task=E5=8F=82=E6=95=B0=E5=90=88?= =?UTF-8?q?=E6=B3=95=E6=80=A7=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Unity/Assets/Model/Core/Async/ETTaskHelper.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Unity/Assets/Model/Core/Async/ETTaskHelper.cs b/Unity/Assets/Model/Core/Async/ETTaskHelper.cs index 77c56eec..88b2da29 100644 --- a/Unity/Assets/Model/Core/Async/ETTaskHelper.cs +++ b/Unity/Assets/Model/Core/Async/ETTaskHelper.cs @@ -43,7 +43,7 @@ namespace ET public static async ETTask WaitAny(ETTask[] tasks) { - if (tasks?.Length == 0) + if (tasks == null || tasks.Length == 0) { return; } @@ -65,7 +65,7 @@ namespace ET public static async ETTask WaitAny(ETTask[] tasks) { - if (tasks?.Length == 0) + if (tasks == null || tasks.Length == 0) { return; } @@ -87,6 +87,10 @@ namespace ET public static async ETTask WaitAll(ETTask[] tasks) { + if (tasks == null || tasks.Length == 0) + { + return; + } CoroutineBlocker coroutineBlocker = new CoroutineBlocker(tasks.Length + 1); foreach (ETTask task in tasks) { @@ -104,6 +108,10 @@ namespace ET public static async ETTask WaitAll(ETTask[] tasks) { + if (tasks == null || tasks.Length == 0) + { + return; + } CoroutineBlocker coroutineBlocker = new CoroutineBlocker(tasks.Length + 1); foreach (ETTask task in tasks) { @@ -121,6 +129,10 @@ namespace ET public static async ETTask WaitAll(List tasks) { + if (tasks == null || tasks.Count == 0) + { + return; + } CoroutineBlocker coroutineBlocker = new CoroutineBlocker(tasks.Count + 1); foreach (ETTask task in tasks) { -- GitLab