Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Commit

Permalink
filetransfer: handle nil FTPTransferAgent in Close
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Feb 5, 2020
1 parent cf58870 commit 26e1d6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/filetransfer/ftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ func tlsDialOption(caFilePath string) (*ftp.DialOption, error) {
}

func (agent *FTPTransferAgent) Close() error {
if agent == nil || agent.conn == nil {
return nil
}
return agent.conn.Quit()
}

Expand Down

0 comments on commit 26e1d6c

Please sign in to comment.