Skip to content

Commit eea71d7

Browse files
v1.2.2 - do not throw null reference if fixture is disposed of without being initialized.
1 parent 89d2c6d commit eea71d7

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

DockerComposeFixture.Tests/DockerFixtureTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,5 +242,12 @@ public void Dispose_CallsDown_WhenRun()
242242

243243
compose.Verify(c => c.Down(), Times.Once);
244244
}
245+
246+
[Fact]
247+
public void Dispose_WithoutInit_DoesNotThrow()
248+
{
249+
var fixture = new DockerFixture(null);
250+
fixture.Dispose();
251+
}
245252
}
246253
}

DockerComposeFixture/DockerComposeFixture.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
5-
<Version>1.2.1</Version>
5+
<Version>1.2.2</Version>
66
<IsTestProject>false</IsTestProject>
77
<Authors>Joe Shearn</Authors>
88
<Product>Docker Compose Fixture</Product>
@@ -13,8 +13,8 @@
1313
<PackageLicenseUrl>https://github.com/devjoes/DockerComposeFixture/blob/master/LICENSE</PackageLicenseUrl>
1414
<RepositoryUrl>https://github.com/devjoes/DockerComposeFixture</RepositoryUrl>
1515
<PackageTags>docker docker-compose xunit</PackageTags>
16-
<PackageReleaseNotes>Fix issue whereby currently running docker compose was not detected</PackageReleaseNotes>
17-
<AssemblyVersion>1.2.1.0</AssemblyVersion>
16+
<PackageReleaseNotes>Do not throw null reference if fixture is disposed of without being initialized.</PackageReleaseNotes>
17+
<AssemblyVersion>1.2.2.0</AssemblyVersion>
1818
</PropertyGroup>
1919

2020
<ItemGroup>

DockerComposeFixture/DockerComposeFixture.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<metadata minClientVersion="2.12">
44
<id>dockercomposefixture</id>
55
<title>docker-compose Fixture</title>
6-
<version>1.2.1</version>
6+
<version>1.2.2</version>
77
<authors>Joe Shearn</authors>
88
<owners>Joe Shearn</owners>
99
<requireLicenseAcceptance>false</requireLicenseAcceptance>

DockerComposeFixture/DockerFixture.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,10 @@ private void Start()
248248

249249
private void Stop()
250250
{
251-
this.dockerCompose.Down();
251+
if (this.dockerCompose != null)
252+
{
253+
this.dockerCompose.Down();
254+
}
252255
}
253-
254-
255256
}
256257
}

0 commit comments

Comments
 (0)