avoid null ref

This commit is contained in:
UbitUmarov
2022-10-02 23:45:57 +01:00
parent 5b4c3c9f33
commit ea83284c87

View File

@@ -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 )
{