From 768179578e5492b5f80c391bd43b233938e16e27 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 24 Jul 2020 09:06:45 -0500 Subject: [PATCH] dont decrement below 0 --- src/Illuminate/Database/Concerns/ManagesTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Concerns/ManagesTransactions.php b/src/Illuminate/Database/Concerns/ManagesTransactions.php index bbefb1e4051b..4d1d2b8efffe 100644 --- a/src/Illuminate/Database/Concerns/ManagesTransactions.php +++ b/src/Illuminate/Database/Concerns/ManagesTransactions.php @@ -186,7 +186,7 @@ public function commit() */ protected function handleCommitTransactionException($e, $currentAttempt, $maxAttempts) { - $this->transactions--; + $this->transactions = max(0, $this->transactions - 1); if ($this->causedByConcurrencyError($e) && $currentAttempt < $maxAttempts) {