GH-3123: Don't logout FtpSession if not connected
Fixes https://github.com/spring-projects/spring-integration/issues/3123
This commit is contained in:
@@ -38,6 +38,7 @@ import org.springframework.util.ObjectUtils;
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
* @author Den Ivanov
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
@@ -154,7 +155,9 @@ public class FtpSession implements Session<FTPFile> {
|
||||
if (this.readingRaw.get() && !finalizeRaw() && LOGGER.isWarnEnabled()) {
|
||||
LOGGER.warn("Finalize on readRaw() returned false for " + this);
|
||||
}
|
||||
this.client.logout();
|
||||
if (this.client.isConnected()) {
|
||||
this.client.logout();
|
||||
}
|
||||
this.client.disconnect();
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user