From 013c78dc77adc9ff4611bf36fc1b9d6173a01586 Mon Sep 17 00:00:00 2001 From: whale Date: Sun, 10 May 2020 14:40:18 +0800 Subject: [PATCH] fix OnTick context bug --- src/ZM/Event/EventHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ZM/Event/EventHandler.php b/src/ZM/Event/EventHandler.php index eca25c95..58402efa 100644 --- a/src/ZM/Event/EventHandler.php +++ b/src/ZM/Event/EventHandler.php @@ -196,7 +196,8 @@ class EventHandler Console::warning("API 激活事件异常!"); return; } - $content = ctx()->copy(); + if (ctx() === null) $content = []; + else $content = ctx()->copy(); go(function () use ($action, $reply, $connection, $content) { set_coroutine_params($content); context()->setCache("action", $action);