Fix num_threads to avoid divide by zero error when running without a thread pool

Signed-off-by: teymour-aldridge <teymour.aldridge@icloud.com>
This commit is contained in:
teymour-aldridge 2020-12-27 19:49:54 +00:00
parent cbda5c3e3e
commit 1f38e3411d
2 changed files with 8 additions and 4 deletions

View file

@ -1404,7 +1404,7 @@ impl LayoutThread {
let pool;
let (thread_pool, num_threads) = if self.parallel_flag {
pool = STYLE_THREAD_POOL.pool();
(pool.as_ref(), STYLE_THREAD_POOL.num_threads)
(pool.as_ref(), STYLE_THREAD_POOL.num_threads.unwrap_or(1))
} else {
(None, 1)
};