aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLazar Kirchev2011-10-24 09:33:39 (EDT)
committerLazar Kirchev2011-10-24 09:33:39 (EDT)
commitd82fca414f7584caf421e43bbc973676d37f8fe8 (patch)
treec4328d653f1c7e072ccb142460eabea9e8cc1495
parent678785ba32eea32e61a67b075be90ef3a2f197c3 (diff)
downloadrt.equinox.bundles-d82fca414f7584caf421e43bbc973676d37f8fe8.zip
rt.equinox.bundles-d82fca414f7584caf421e43bbc973676d37f8fe8.tar.gz
rt.equinox.bundles-d82fca414f7584caf421e43bbc973676d37f8fe8.tar.bz2
Improve behavior on stop if no Ssh server has been startedv20111024-1601
-rwxr-xr-xbundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshCommand.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshCommand.java b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshCommand.java
index 64440ad..88ef0a7 100755
--- a/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshCommand.java
+++ b/bundles/org.eclipse.equinox.console.ssh/src/org/eclipse/equinox/console/ssh/SshCommand.java
@@ -187,7 +187,8 @@ public class SshCommand {
}
} else if ("stop".equals(command)) {
if (sshServ == null) {
- throw new IllegalStateException("ssh is not running.");
+ System.out.println("ssh is not running.");
+ return;
}
sshServ.stopSshServer();
@@ -197,12 +198,16 @@ public class SshCommand {
public synchronized void addCommandProcessor(CommandProcessor processor) {
processors.add(processor);
- sshServ.addCommandProcessor(processor);
+ if (sshServ != null) {
+ sshServ.addCommandProcessor(processor);
+ }
}
public synchronized void removeCommandProcessor(CommandProcessor processor) {
processors.remove(processor);
- sshServ.removeCommandProcessor(processor);
+ if (sshServ != null) {
+ sshServ.removeCommandProcessor(processor);
+ }
}
private void checkPortAvailable(int port) throws Exception {