aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-06-14 09:40:08 +0100
committerMatthew Wild <mwild1@gmail.com>2020-06-14 09:40:08 +0100
commite40ea08629de93e021547cba05c36eaf55945c01 (patch)
tree51d6e2ac54642a9efac0ec838c451027b17b3fb2
parentcdfa305a67507d6e7f36a943c2bb599359a54059 (diff)
downloadprosody-e40ea08629de93e021547cba05c36eaf55945c01.tar.gz
prosody-e40ea08629de93e021547cba05c36eaf55945c01.zip
util.async: Don't attempt to close thread if not created yet
-rw-r--r--util/async.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/async.lua b/util/async.lua
index 24378d8c..341128d2 100644
--- a/util/async.lua
+++ b/util/async.lua
@@ -160,7 +160,7 @@ function runner_mt:run(input)
local q, thread = self.queue, self.thread;
if not thread or coroutine.status(thread) == "dead" then
--luacheck: ignore 143/coroutine
- if coroutine.close then
+ if thread and coroutine.close then
coroutine.close(thread);
end
self:log("debug", "creating new coroutine");