diff --git a/kiri-engine/Context.php b/kiri-engine/Context.php index a722661e..ed7d01b2 100644 --- a/kiri-engine/Context.php +++ b/kiri-engine/Context.php @@ -186,8 +186,9 @@ class Context extends BaseContext if (!isset(Coroutine::getContext($coroutineId)[$id])) { return false; } - if ($key !== null) { - return isset((Coroutine::getContext($coroutineId)[$id] ?? [])[$key]); + $value = Coroutine::getContext($coroutineId)[$id]; + if ($key !== null && is_array($value)) { + return isset($value[$key]); } return true; }