Skip to content

Commit 27debc8

Browse files
committed
Another simplified null check
1 parent 44f8786 commit 27debc8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/NServiceBus.NHibernate/Outbox/NHibernateLocalOutboxTransaction.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,8 @@ public async Task Commit(CancellationToken cancellationToken = default)
4949
public void Dispose()
5050
{
5151
//If save changes callback failed, we need to dispose the transaction here.
52-
if (transaction != null)
53-
{
54-
transaction.Dispose();
55-
transaction = null;
56-
}
52+
transaction?.Dispose();
53+
transaction = null;
5754
Session.Dispose();
5855
}
5956

0 commit comments

Comments
 (0)