diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 846682b9..be3b66f8 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -50,7 +50,7 @@ class Connection extends Component return; } $connection = Context::getContext($coroutineName); - if (!$connection->inTransaction()) { + if (!$connection?->inTransaction()) { $connection->beginTransaction(); } } @@ -66,7 +66,7 @@ class Connection extends Component return; } $connection = Context::getContext($coroutineName); - if ($connection->inTransaction()) { + if ($connection?->inTransaction()) { $connection->commit(); } } @@ -83,7 +83,7 @@ class Connection extends Component return; } if (($connection = Context::getContext($coroutineName)) instanceof PDO) { - if ($connection->inTransaction()) { + if ($connection?->inTransaction()) { $connection->rollBack(); } }