Skip to content

Commit

Permalink
(#199) Fix for null reference pointer in DisposeAsync when not runnin…
Browse files Browse the repository at this point in the history
…g live tests.
  • Loading branch information
adrianhall committed Jan 30, 2025
1 parent 56c1f9f commit fa947b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public async Task InitializeAsync()

public async Task DisposeAsync()
{
await Context.DisposeAsync();
if (Context is not null)
{
await Context.DisposeAsync();
}
}

private CosmosDbContext Context { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected override Task<string> GetRandomEntityIdAsync(bool exists)
/// We test the 400 Bad Request client-side evaluation error here because Cosmos has more restrictions than most,
/// so it's easier to test the code path.
/// </summary>
[Fact]
[SkippableFact]
public async Task ClientSideEvaluation_Produces_400BadRequest()
{
Skip.IfNot(CanRunLiveTests());
Expand Down

0 comments on commit fa947b3

Please sign in to comment.