This commit is contained in:
2021-01-19 18:50:42 +08:00
parent 335be2ed9c
commit 071e3d5667
+7 -1
View File
@@ -173,7 +173,13 @@ class Context extends BaseContext
public static function hasContext($id, $key = null): bool
{
if (!static::inCoroutine()) {
return false;
if (!isset(static::$_requests[$id]) || empty(static::$_requests[$id])) {
return false;
}
if (!empty($key) && !isset(static::$_requests[$id][$key])) {
return false;
}
return true;
}
if (!isset(Coroutine::getContext()[$id])) {
return false;