Fix startup issue of closing a nonexistent connection

This commit is contained in:
Tony Blyler 2016-05-24 22:21:57 -04:00
parent ba49a850a2
commit 9e49d266cf
No known key found for this signature in database
GPG key ID: 25C9D3A655D1A65C

View file

@ -399,8 +399,10 @@ func (q *Queue) Run(stop <-chan bool) {
if len(downloadsRunning) == 0 {
// close the sftp connection since it is not being used
q.sftpClient.Close()
q.sftpClient = nil
if q.sftpClient != nil {
q.sftpClient.Close()
q.sftpClient = nil
}
} else {
cont = true
for cont {