From 64c818d6e892148aa3e448ea62a698bc5136c4cd Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Mon, 9 Aug 2021 01:59:15 +0800 Subject: [PATCH] modify --- System/Pool/Connection.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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(); } }