1
0
mirror of https://github.com/docker/cli.git synced 2026-01-13 18:22:35 +03:00

integration-cli: check nil before Close'ing

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 11a95b951435b63accae8765f7ace97c73f133d0
Component: engine
This commit is contained in:
Antonio Murdaca
2016-01-13 10:51:01 +01:00
parent 69c1610f93
commit c1149a155a

View File

@@ -57,10 +57,10 @@ func (s *DockerRegistrySuite) TearDownTest(c *check.C) {
if s.reg != nil {
s.reg.Close()
}
if s.ds != nil {
s.ds.TearDownTest(c)
if s.d != nil {
s.d.Stop()
}
s.d.Stop()
s.ds.TearDownTest(c)
}
func init() {
@@ -85,10 +85,10 @@ func (s *DockerSchema1RegistrySuite) TearDownTest(c *check.C) {
if s.reg != nil {
s.reg.Close()
}
if s.ds != nil {
s.ds.TearDownTest(c)
if s.d != nil {
s.d.Stop()
}
s.d.Stop()
s.ds.TearDownTest(c)
}
func init() {
@@ -109,7 +109,9 @@ func (s *DockerDaemonSuite) SetUpTest(c *check.C) {
func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
testRequires(c, DaemonIsLinux)
s.d.Stop()
if s.d != nil {
s.d.Stop()
}
s.ds.TearDownTest(c)
}
@@ -131,7 +133,11 @@ func (s *DockerTrustSuite) SetUpTest(c *check.C) {
}
func (s *DockerTrustSuite) TearDownTest(c *check.C) {
s.reg.Close()
s.not.Close()
if s.reg != nil {
s.reg.Close()
}
if s.not != nil {
s.not.Close()
}
s.ds.TearDownTest(c)
}