}
return session;
} catch (JSchException e) {
+ if (sshTarget.getUserInfo() instanceof SimpleUserInfo)
+ ((SimpleUserInfo) sshTarget.getUserInfo()).reset();
throw new SlcException("Could not open session to "
+ getSshTarget(), e);
}
}
- public final void run() {
+ public void run() {
Session session = openSession();
try {
run(session);
} finally {
- if (sshTarget.getSession() == null) {
+ if (sshTarget != null && sshTarget.getSession() == null) {
session.disconnect();
if (log.isDebugEnabled())
log.debug("Disconnected from " + getSshTarget()