Fixes #3628 - NPE in QueuedThreadPool.getReservedThreads().

Added guard to avoid NPE.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2019-05-07 12:53:15 +02:00
parent 6c6646286d
commit e45c176649
1 changed files with 5 additions and 1 deletions

View File

@ -394,7 +394,11 @@ public class QueuedThreadPool extends ContainerLifeCycle implements SizedThreadP
public int getReservedThreads()
{
if (isStarted())
return getBean(ReservedThreadExecutor.class).getCapacity();
{
ReservedThreadExecutor reservedThreadExecutor = getBean(ReservedThreadExecutor.class);
if (reservedThreadExecutor != null)
return reservedThreadExecutor.getCapacity();
}
return _reservedThreads;
}