Skip to content

Commit 08cfb4e

Browse files
committed
Use analyzer-suggested null propagation
1 parent 3628fe1 commit 08cfb4e

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/NServiceBus.RavenDB.AcceptanceTests/When_injecting_the_raven_session.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ await Scenario.Define<RavenSessionTestContext>()
4242
}
4343
finally
4444
{
45-
if (session != null)
46-
{
47-
session.Dispose();
48-
session = null;
49-
}
45+
session?.Dispose();
46+
session = null;
5047

5148
if (documentStore != null)
5249
{

src/NServiceBus.RavenDB.AcceptanceTests/When_raven_session_is_provided.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ public async Task It_should_return_configured_session()
3737
}
3838
finally
3939
{
40-
if (session != null)
41-
{
42-
session.Dispose();
43-
session = null;
44-
}
40+
session?.Dispose();
41+
session = null;
4542

4643
if (documentStore != null)
4744
{

0 commit comments

Comments
 (0)