1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00

[235577] handle the "" case

This commit is contained in:
David McKnight 2008-07-08 17:59:29 +00:00
parent f5a5863252
commit 7f0b8e06e2

View file

@ -303,7 +303,16 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
if (launchType == ServerLaunchType.REXEC_LITERAL) if (launchType == ServerLaunchType.REXEC_LITERAL)
{ {
String port = getREXECPort(); String port = getREXECPort();
int portAsInt = Integer.parseInt(port);
int portAsInt = 0;
if (port != null && port.length() > 0){
try {
portAsInt = Integer.parseInt(port);
}
catch (Exception e){
portAsInt = 0;
}
}
msg = _rexecPortValidator.validate(port); msg = _rexecPortValidator.validate(port);
@ -337,8 +346,17 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
else if (launchType == ServerLaunchType.DAEMON_LITERAL) else if (launchType == ServerLaunchType.DAEMON_LITERAL)
{ {
String port = getDaemonPort(); String port = getDaemonPort();
int portAsInt = 0;
if (port != null && port.length() > 0){
try {
portAsInt = Integer.parseInt(port);
}
catch (Exception e){
portAsInt = 0;
}
}
int portAsInt = Integer.parseInt(port);
msg = _daemonPortValidator.validate(port); msg = _daemonPortValidator.validate(port);
// for daemons we don't allow 0 // for daemons we don't allow 0