From ea83284c87122056d636d5db2eb7a3477e8449ac Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 2 Oct 2022 23:45:57 +0100 Subject: [PATCH] avoid null ref --- ThirdParty/SmartThreadPool/SmartThreadPool.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ThirdParty/SmartThreadPool/SmartThreadPool.cs b/ThirdParty/SmartThreadPool/SmartThreadPool.cs index 3522658476..0fd0dc68a0 100644 --- a/ThirdParty/SmartThreadPool/SmartThreadPool.cs +++ b/ThirdParty/SmartThreadPool/SmartThreadPool.cs @@ -863,6 +863,9 @@ namespace Amib.Threading // Each iteration we update the time left for the timeout. foreach (ThreadEntry te in threadEntries) { + if (te == null) + continue; + Thread thread = te.WorkThread; // Join don't work with negative numbers @@ -894,6 +897,9 @@ namespace Amib.Threading // Abort the threads in the pool foreach (ThreadEntry te in threadEntries) { + if (te == null) + continue; + Thread thread = te.WorkThread; if ((thread != null) && thread.IsAlive ) {