From 9e49d266cfd89909eaa39e6ea2a844e91c722a56 Mon Sep 17 00:00:00 2001 From: Tony Blyler Date: Tue, 24 May 2016 22:21:57 -0400 Subject: [PATCH] Fix startup issue of closing a nonexistent connection --- queue/queue.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/queue/queue.go b/queue/queue.go index 517dc86..1ea037d 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -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 {