Make sure channel and connection exists before closing
This commit is contained in:
@@ -110,8 +110,12 @@ func (m *manager) disconnect(instance *types.Instance) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
t := m.terminals[instance.Name]
|
t := m.terminals[instance.Name]
|
||||||
close(t.write)
|
if t.write != nil {
|
||||||
t.conn.Close()
|
close(t.write)
|
||||||
|
}
|
||||||
|
if t.conn != nil {
|
||||||
|
t.conn.Close()
|
||||||
|
}
|
||||||
m.untrackInstance(instance)
|
m.untrackInstance(instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user