diff options
author | Ruben Pollan <meskio@sindominio.net> | 2019-08-07 18:13:19 -0400 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2019-08-07 18:13:19 -0400 |
commit | e4fbb2f00eb6e1b7591d5cada55dbc95a83b50b4 (patch) | |
tree | e6b4eeecef85b9707ef9f9dac4e9a47c4f02d6ce | |
parent | 9201d6c1c18dc6bebe2b3931bed2f413d47f26d5 (diff) |
Close the listener if it has being initialized
-rw-r--r-- | shapeshifter.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shapeshifter.go b/shapeshifter.go index d17873c..4211df6 100644 --- a/shapeshifter.go +++ b/shapeshifter.go @@ -34,7 +34,10 @@ func (ss *ShapeShifter) Open() error { } func (ss *ShapeShifter) Close() error { - return ss.ln.Close() + if ss.ln != nil { + return ss.ln.Close() + } + return nil } func (ss ShapeShifter) clientAcceptLoop() error { |