Skip to content

Commit

Permalink
make sure not subtraction overflow occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
LucianBuzzo committed Nov 9, 2024
1 parent 1c82c28 commit 5b3d89e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions query-engine/driver-adapters/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ impl QuaintTransaction for JsTransaction {
}

// Modify the depth value
self.depth -= 1;
if self.depth > 0 {
self.depth -= 1;
}

let _ = UnsafeFuture(self.tx_proxy.commit()).await;

Expand All @@ -166,7 +168,9 @@ impl QuaintTransaction for JsTransaction {
}

// Modify the depth value
self.depth -= 1;
if self.depth > 0 {
self.depth -= 1;
}

let _ = UnsafeFuture(self.tx_proxy.rollback()).await;

Expand Down

0 comments on commit 5b3d89e

Please sign in to comment.