File tree Expand file tree Collapse file tree
DockerComposeFixture.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 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 >
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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments