Skip to content

Commit 0421862

Browse files
committed
chore(spanner): return in interceptor if txn is not created
1 parent faa3e51 commit 0421862

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ITAbstractSpannerTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ public void intercept(
148148
if (usingMultiplexedsession) {
149149
Field stateField = cls.getDeclaredField("txnState");
150150
stateField.setAccessible(true);
151+
if(tx.getState() == null) {
152+
return;
153+
}
151154
tx.rollback();
152155
stateField.set(tx, TransactionState.ABORTED);
153156
} else {

0 commit comments

Comments
 (0)