File tree

6 files changed

+608
-158
lines changed

6 files changed

+608
-158
lines changed
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public ApiFuture<Void> closeAsync() {
6666
if (txnState == TransactionState.STARTED) {
6767
res = rollbackAsync();
6868
}
69-
txn.close();
69+
if (txn != null) {
70+
txn.close();
71+
}
7072
return MoreObjects.firstNonNull(res, ApiFutures.<Void>immediateFuture(null));
7173
}
7274

@@ -172,7 +174,7 @@ public ApiFuture<Void> apply(Empty input) throws Exception {
172174

173175
@Override
174176
public TransactionContextFuture resetForRetryAsync() {
175-
if (txn == null || !txn.isAborted() && txnState != TransactionState.ABORTED) {
177+
if (txn == null || (!txn.isAborted() && txnState != TransactionState.ABORTED)) {
176178
throw new IllegalStateException(
177179
"resetForRetry can only be called if the previous attempt aborted");
178180
}

0 commit comments

Comments
 (0)